[standards-jig] Flagging stream errors before the stream is established

Robert Norris rob at cataclysm.cx
Mon Sep 16 05:31:43 UTC 2002

I've run into a small quirk while implementing 1.5, and thought it
should really be documented.

It's possible for an error to occur before the XML stream is
established. The stream header may be invalid (bad namespace, to
address, etc), or something else may happen that we need to tell the
client about before we kick them (eg they've been rate limited).

This seems to be handled differently in different servers. 1.4 does

% telnet localhost 5370
Connected to
Escape character is '^]'.
<stream:error>Invalid XML</stream:error>
Connection closed by foreign host.

The server at jabber.com is a bit different:

% telnet jabber.com 5222
Connected to jabber.com.
Escape character is '^]'.
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'><stream:error>Invalid stream headers. Closing connection!</stream:error></stream:stream>
Connection closed by foreign host.

The latter is "correct", according to the schema (xmpp-core, section
4.8), but it also "establishes" a stream for the purposes of sending the
area, which requires some (not much) extra processing.

The first is not namespaced correctly, but does seem nicer (less
verbose, and doesn't require establishing the stream). It might be a
better choice if it were namespaced correctly, eg:

<stream:error xmlns:stream='http://etherx.jabber.org/streams'>Invalid XML</stream:error>

At the very least, we should document what should happen in this case.
What do others think?

Robert Norris                                       GPG: 1024D/FC18E6C2
Email+Jabber: rob at cataclysm.cx                Web: http://cataclysm.cx/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.jabber.org/pipermail/standards/attachments/20020916/45e3f4ea/attachment.sig>

More information about the Standards mailing list