Skip navigation
5363 Views 8 Replies Latest reply: Nov 26, 2008 2:34 PM by Sajid RSS
BenV Bronze 92 posts since
Jan 25, 2007
Currently Being Moderated

Nov 17, 2008 3:44 PM

[PATCH] XMLSocket Flash Client Support 3.6.0+

I believe Openfire 3.6.0 broke support for XMLSocket Flash clients which append a NULL byte at the end of messages. There is currently a line in XMLLightweightParser which throws an exception if a NULL byte is parsed. To work around this issue, an exception for NULL bytes needs to be added around line 207:

 

ch = buf[i];
            
if (ch < 0x20 && ch != 0x9 && ch != 0xA && ch != 0xD && ch != 0x0) {
     //Unicode characters in the range 0x0000-0x001F other than 9, A, and D are not allowed in XML
     //We need to allow the NULL character, however, for Flash XMLSocket clients to work.
     throw new Exception("Disallowed character");
}

 

I'm not sure if there is a better way to do this, as the isFlash() method doesn't work on a connection until the first stanza has been received. Previously, the connection was being terminated when the Flash movie sends the initial <policy-file-request/>.

 

It would be nice if this (or something similar to it) could be merged into the main branch. I don't have enough knowledge to know if anything depends on NULL bytes throwing an exception or not, but it definitely sucks to have Flash clients broken.

 

Edit: Previous patch was throwing an exception in some cases, sorry about that This new one works for me, please try it out.

Attachments:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points