[Standards] stream restarts

Matthew A. Miller linuxwolf at outer-planes.net
Thu May 8 03:42:02 UTC 2008

On May 7, 2008, at 20:48, Stephen Pendleton wrote:

> I don't understand why you would be concerned if what was flowing  
> through the socket was a mix of ascii then "binary" data. When all  
> is said and done the XML parser sees XML. The TLS and compression is  
> handled outside of the parser, in other layers. The XML parser  
> doesn't need to know anything about that. The parser only sees a  
> single <stream:stream> in the new scheme and a valid XML document (I  
> think).

In my experience, all but the most complex of event-driven APIs rely  
on an uninterrupted parse over a continuous I/O stream.  Implementing  
the current logic turns out to be fairly easy with these existing  

"Simply" inserting a TLS wrap/unwrap stage is trivial to do with the  
expat C API.  However, it's incredibly complex with the vast majority  
of XML parsers.  For these, it's pretty easy to stop the current  
processing, throw out the previous parser, and create a new parser  
with the TLS and/or SASL unwrap next in the I/O stack.

Matthew A. Miller
linuxwolf at outer-planes.net

> > Date: Wed, 7 May 2008 22:42:54 +0100
> > From: dave at cridland.net
> > To: standards at xmpp.org
> > Subject: Re: [Standards] stream restarts
> >
> >
> > You've run together three different streams, with four different XML
> > streams running inside them. Apologies for the overloading of the
> > term "stream" - I can't think of a better word right now.
> >
> > When you say "[TLS negotiation]" and continue with other XML, what
> > you actually could do more accurately is write "[Unreadable TLS 8- 
> bit
> > non-line-orientated data]". Much the same where you don't mention  
> the
> > layer insertion at all at the XEP-0138 point. This is what Justin
> > means by saying that it reduces the "XMLishness" of the XML stream -
> > it really isn't a complete document without those stream restarts.
> >
> > Frankly, I'm not bothered at all by whether it's classically XML or
> > not, it's much more interesting, to me, to argue this one over
> > round-trips, and other things which are actually useful - I'm afraid
> > I'm with Curtis, whether you think stream restarts are evil or not,
> > they're here to stay, now, irregardless of whether we try to avoid
> > them.
> >
> > Dave.
> > --
> > Dave Cridland - mailto:dave at cridland.net - xmpp:dwd at jabber.org
> > - acap://acap.dave.cridland.net/byowner/user/dwd/bookmarks/
> > - http://dave.cridland.net/
> > Infotrope Polymer - ACAP, IMAP, ESMTP, and Lemonade
> Get Free (PRODUCT) RED™ Emoticons, Winks and Display Pics. Check it  
> out!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2238 bytes
Desc: not available
URL: <http://mail.jabber.org/pipermail/standards/attachments/20080507/f60c2f26/attachment.bin>

More information about the Standards mailing list