Community
Participate
Working Groups
I am using ECF 2.0.0.v20080514 I am seeing very frequently parsing problems in the ChatSession.read() method which lead to exception which causes the death of the Session$IdleThread that processes the received messages. If an unexpected Exception occurs I can no longer receive messages in the current session. So perhaps it is better to protect the Session$IdleThread from any uncaught exceptions. One of the cases that leads to the described behavior is this: The original received message which is being processed by the ChatSession.read(): "MSG s_boshev@prosyst.bg s_boshev@prosyst.bg 129 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-MMS-IM-Format: FN=MS%20Shell%20Dlg; EF=; CO=0; CS=cc; PF=0 e de" This leads to this exception: Exception in thread "Thread-12" java.lang.StringIndexOutOfBoundsException: String index out of range: 5 at java.lang.String.checkBounds(String.java:402) at java.lang.String.<init>(String.java:443) at org.eclipse.ecf.protocol.msn.ChatSession.read(ChatSession.java:295) at org.eclipse.ecf.protocol.msn.Session$IdleThread.run(Session.java:287)
Adding Remy.
Putting in my bucket.
I dug more into the problem. It seems the problem occurs when a message that ends with one or more spaces is received. The read method trims the spaces and therefore the message that is being parsed contains less characters than expected.
Created attachment 100765 [details] Patch for the processing of read messages bugs The patch fixes the problems which are related to: - processing of messaged that end with white spaces - unexpected exception leads to stop of the processing of further received messages - processing of messages that contain leading new lines like "\r\n\r\nsome message" (such messages were displayed like "")
Remy, if you can take a look at this and apply/test/release to HEAD before Mon 19 we'll get this fix into RC1. In any event thanks Stoyan for the contribution.
Created attachment 100814 [details] Revised patch against HEAD. This new patch only "ignores" RuntimeExceptions and not all Throwables. I'm pretty sure we don't want to be ignoring java.lang.Errors. :) Scott, can I get a +1 here?
(In reply to comment #6) > Created an attachment (id=100814) [details] > Revised patch against HEAD. > > This new patch only "ignores" RuntimeExceptions and not all Throwables. I'm > pretty sure we don't want to be ignoring java.lang.Errors. :) > > Scott, can I get a +1 here? > +1 Thanks for addressing quickly.
Patch released to HEAD. Thanks for the help, Stoyan!
Whoops, forgot to resolve.
Added contributed keyword.