[jdev] Expected behavior when a presence comes too early

Peter Saint-Andre stpeter at stpeter.im
Wed Aug 24 22:54:26 UTC 2011

On 8/24/11 4:50 PM, Daniel Dormont wrote:
> Hi, in a BOSH application I'm developing, I accidentally allowed a
> race condition in which the client would send a presence packet
> (specifically a MUC presence, but I have a feeling that's not
> germaine) before the session had been fully established. Specifically,
> after connecting, the client would send an "auth" packet, but before
> receiving the <success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>
> response, it would go ahead and send the presence.
> I'm not an XMPP expert and so honestly I'm not entirely sure this is
> even improper behavior, but if it is, what is the expected response
> from the server? I ask because in Ejabberd's case it sends a
> <stream:error> <xml-not-well-formed
> xmlns='urn:ietf:params:xml:ns:xmpp-streams'/> response, which sent me
> on a wild goose chase looking for malformed XML. If it's a bug in
> Ejabberd I'm happy to pursue it there but first I wanted to understand
> the expected behavior a little better.

The proper error condition is <not-authorized/> as noted in RFC 6120:



Peter Saint-Andre

More information about the JDev mailing list