2 Replies Latest reply on Mar 22, 2011 6:43 AM by zyz

    StompDecoder bug fix

    zyz

      Hello!

       

      There`s a bug in current (2.2.0 CR1)  org.hornetq.core.protocol.stomp.StompDecoder.

      When a client transmits STOMP frames by successive send()`s (like http://stomp.codehaus.org/C) threre`s sometimes a case when the body has already been received but terminating NUL is still pending. This leads to ArrayIndexOutOfBoundsException on next decode() call. More commented in the code.

       

      Also a light optimization is suggested to avoid unnecessary second call to decode() for those clients terminating frames with both NUL and \n.

       

      The changed code comments are marked with ZaitsevY.