I know we discussed this shortly on the groupchat, but I thought I’'d bring it up here for ideas/suggestions.
Currently, if Smack receives XML it can’'t parse (not well formed, etc), you get disconnected. Is there any way around this? Anyone that knows that this is true can disconnect you at any time using their XML console from almost any client.
Hmm, yes, I can see that can be a problem. I can’‘t think of a particularly nice solution to do this using Smack, but one thing you can do is to modify the source so that if the XML parser fails, it can return null (and then ignore null values from the XML parser). Just an idea. I’'m sure someone has a better one.
There’‘s only one case that I can think of that would be a problem, which is that Smack isn’'t likely doing namespace checking when looking for closing elements. If it was, than a server should make sure that everything else is well-formed.
its not exactly ill-formed, as in all of the openings and closings aren’‘t there but there shouldn’'t be any html inside of a body, it should be inside of an xhtml extension
Yea, i realize this, I should of clarified, I was just trying to point out what was wrong with the packet you posted. I’‘m 1000% with you on this. Didn’'t even think about the muc history case too.
I did not aim this towards the google chat on wensday. This seems to be the case with any client created with the smack api.
Be it a simple one to one message or a Group Chat. The malformed xml packet still closes anyones client who receives it.
If anything… I am just curious that something is being done on the smack side of this.
noahcampbell: I wasn’‘t commenting on your particular correlation about last weeks chat. I didn’'t even make it in time for the meeting, so I did not witness it go down.
A possible solution to this would be to write a PacketErrorHandler interface that receives the stack trace and packet when a packet parsing error occurs. There will then be a default one that perhaps logs it in the debugger and client developers can write ones of their own that drop’'s the connection or chucks the packet, whatever they would like.