Ejabberd disconnects with the client if it experience a bad xml from the client. Is it possible to configure ejabberd not to disconnect in such cases?
-
What do you mean by "disconnects with the client"? Is only the client disconnected from the server and the server runs fine or is the server shutting down as well when invalid XML is send from the client to the server? – Progman Mar 18 '19 at 18:55
-
Server disconnects for that particular client, from where the bad xml was received. Otherwise the server is running fine. – Umar Murtaza Mar 19 '19 at 13:01
-
Why should the connection kept open when the client has send invalid XML? Sounds reasonable to drop the connection when the client doesn't use the proper protocol to communicate with the server. – Progman Mar 19 '19 at 18:40
-
having same issue, any update on this? – Adiii Jun 17 '19 at 11:58
3 Answers
I didn't found any related option in https://docs.ejabberd.im/admin/configuration/ and I guess that won't exist.

- 3,840
- 1
- 8
- 9
You can use a reconnecting mechanism so that the application can reconnect automatically whenever the internet connection lost or an error occurs (depending on your requirement).
As an example this is the reconnection manager for Smack
Some similar questions where you might find a solution

- 987
- 2
- 12
- 27
It is standard behaviour for a server to disconnect on malformed XML, because there is no good way to recover from such mistake. For example, if you forget to close a tag, then, your whole stream is broken, because all stanzas are suddenly at the wrong level.
There is no reason for a client to send invalid XMPP stanza. This should be considered a bug to fix in the client. If you accept user input causing the stanza to get malformed, you need to proerly encode / escape the content.

- 9,035
- 1
- 24
- 44