Report the original stream:error stanza to clients.
authorGlenn Maynard <glenn@zewt.org>
Thu, 28 Apr 2011 04:53:59 +0000 (00:53 -0400)
committerGlenn Maynard <glenn@zewt.org>
Thu, 28 Apr 2011 04:53:59 +0000 (00:53 -0400)
commit202d50656ea8e733d37e2d953b99706bd44e6206
treea85284f8462de5eb61e47158b97df66984028e0d
parent324ea55c8df27bdf49b7ddf9f5612e6021e42fce
Report the original stream:error stanza to clients.

When a stream:error was received, the error was parsed, converted to a
StreamError exception, then XML was recreated from that.  This is roundabout
and lossy: it's parsing the XML, then attempting to recreate the same XML
that it already had.

Instead, keep the original XML node in the exception, and use it directly.
This ensures that the <stream:error> node in remote-stream-error is
unchanged from what we received from the remote server.  Any extensions
will be passed through unchanged, as should happen for all stanzas.

For example, the <stream:error> node reported by Jabber14 now correctly
reproduces its xmlns='jabber:client' attribute.

The simple patch in patches.py should eventually be sent upstream.
punjab/__init__.py
punjab/patches.py [new file with mode: 0644]
punjab/session.py