BoshServlet – Bugs and fixes

No bugs ???

Kj [/.] Sreekumar programs computers as a hobby and profession. Into programming from his school days, Sree uses Codemarvels to key in facts and fixes he finds interesting while working on different projects. Some of the articles here give away a few shades of his philosophical leanings too.


  1. Hi,

    I think I found a bug….any time you parse the rid within the ConnectionManager, the code should use Long.parseLong, not Integer.parseInt. And the rid value that results should always be stored in a long. The XMPP BOSH spec says that the value can be very very large (past the 32 bits allowed for an int). And strophe.js, the implementation to make browser based requests easy very commonly generates rids larger than 2^32-1.

    I found the same bug in JabberHTTPBind and submitted it to them as well. I’m just getting started with your code and saw that the same issue exists.


    1. Hey Thanks Mark !
      Will be posting the updated code soon.

      *Sorry for the delay, there were so much spam, I could find your comment only while cleaning up today.

  2. I stumbled over the rid-thing, too.

    But I had also other problems, while implementing a MinimalHandler to get a 1:1 transmission to a backendserver, using base64 in the communication between bosh-client and bosh-server:

    -Please use byte[], not Strings communicating to the backendserver. This is crucial for binary protocols.
    -Please don’t crash if no route is provided while connecting.
    -The buffersize of 512 can be increased to e.g. 4096 to gain more performance. Even with the current buffersize, 2 packets are needed because of overhead
    -I got some concurrent modification errors, e.h. at the sessions.values().iterator() at ConnectionManager:522. I got similar problems at add/removeResponse in BOSHSession
    -sometimes packets aren’t received in the right order -> checkValidRID get problems

    But now it works rather fine, despite a few problems using it as a proxy for http-servers (the browsers do make many concurrent connections etc.)

  3. hi got error while using strophe.js

    [Fatal Error] :1:11: The processing instruction target matching “[xX][mM][lL]” is not allowed.
    [Fatal Error] :1:11: The processing instruction target matching “[xX][mM][lL]” is not allowed.

    [Fatal Error] :1:11: The processing instruction target matching “[xX][mM][lL]” is not allowed
    any idea

Leave a Comment

Your email address will not be published. Required fields are marked *