BOSH should properly handle connection errors
Currently I get a traceback when my server sends for example "host-unknown". Debug log:
2009-01-09 18:26:59,882 gajim.c.x.client_nb: INFO: raising event from transport: :::::DATA RECEIVED::::
_____________
HTTP/1.0 200 OK
Connection: close
Content-Length: 99
\<body type='terminate' condition='host-unknown' xmlns='http://jabber.org/protocol/httpbind'>\</body>
_____________
2009-01-09 18:26:59,883 gajim.c.x.client_nb: INFO: -------------xmpp_connect_machine() >> mode: RECEIVE_DOCUMENT_ATTRIBUTES, data: \<body type='terminat...
2009-01-09 18:26:59,884 gajim.c.x.simplexml: INFO: STARTTAG.. DEPTH -> 1 , tag -> stream:stream, attrs -> {u'xmlns:stream': u'http://etherx.jabber.org/streams', u'xmlns': u'jabber:client', u'from': u'getsjabber.ath.cx', u'version': u'1.0', u'xml:lang': u'en'}
2009-01-09 18:26:59,884 gajim.c.x.simplexml: INFO: STARTTAG.. DEPTH -> 2 , tag -> body, attrs -> {u'xmlns': u'http://jabber.org/protocol/httpbind', u'type': u'terminate', u'condition': u'host-unknown'}
2009-01-09 18:26:59,885 gajim.c.x.simplexml: INFO: DEPTH -> 2 , tag -> body
2009-01-09 18:26:59,885 gajim.c.x.bosh: ERROR: Received terminating stanza: host-unknown - The target domain specified in the "to" attribute or the target host or port specified in the "route" attribute is unknown to the connection manager.
2009-01-09 18:26:59,886 gajim.c.x.client_nb: INFO: Disconnecting NBClient:
2009-01-09 18:26:59,886 gajim.c.x.plugin: INFO: Plugging \<common.xmpp.bosh.NonBlockingBOSH instance at 0x89fb52c> __OUT__ of \<common.xmpp.client_nb.NonBlockingClient instance at 0x89edf4c>.
2009-01-09 18:26:59,901 gajim.c.x.client_nb: INFO: setting RECEIVE_STREAM_FEATURES on next receive
Traceback (most recent call last):
File "/home/matthew/Development/Software/gajim/src/common/xmpp/idlequeue.py", line 339, in _process_events
return IdleQueue._process_events(self, fd, flags)
File "/home/matthew/Development/Software/gajim/src/common/xmpp/idlequeue.py", line 212, in _process_events
obj.pollin()
File "/home/matthew/Development/Software/gajim/src/common/xmpp/transports_nb.py", line 367, in pollin
self._do_receive()
File "/home/matthew/Development/Software/gajim/src/common/xmpp/transports_nb.py", line 543, in _do_receive
self._on_receive(received)
File "/home/matthew/Development/Software/gajim/src/common/xmpp/transports_nb.py", line 648, in _on_receive
self.on_receive(data=httpbody, socket=self)
File "/home/matthew/Development/Software/gajim/src/common/xmpp/bosh.py", line 450, in on_received_http
self.current_recv_handler(data)
File "/home/matthew/Development/Software/gajim/src/common/xmpp/client_nb.py", line 290, in \<lambda>
self.onreceive(lambda _data:self._xmpp_connect_machine(mode, _data))
File "/home/matthew/Development/Software/gajim/src/common/xmpp/client_nb.py", line 313, in _xmpp_connect_machine
on_next_receive('RECEIVE_STREAM_FEATURES')
File "/home/matthew/Development/Software/gajim/src/common/xmpp/client_nb.py", line 290, in on_next_receive
self.onreceive(lambda _data:self._xmpp_connect_machine(mode, _data))
AttributeError: NonBlockingClient instance has no attribute 'onreceive'