Ticket #2634 (reopened defect)
Gajim fails to assemble partial data
| Reported by: | junglecow | Owned by: | dkirov |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | xmpppy | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Blocked By: | ||
| OS: | All | Blocking: |
Description
setting RECV_BUFSIZE to 16 in common/xmpp/transports_nb.py causes the connection to break without any warning or error, even in debug mode:
DEBUG: dispatcher info Registering protocol "message" as common.xmpp.protocol.Message(jabber:client) DEBUG: socket sent <?xml version='1.0'?> <stream:stream xmlns="jabber:client" to="gajim.org" version="1.0" xmlns:stream="http://etherx.jabber.org/streams" > DEBUG: socket got <?xml version='1 DEBUG: client stop Disconnect detected
Setting RECV_BUFSIZE to 1048576 (the original value) in no way guarantees that we'll never receive partial XML stanzas. Networking just doesn't work that way. Not printing any warnings in case of protocol errors is a bug in itself. If this happens we experience a disconnect and probably think the cause is a network problem, while it's actually Gajim's fault. (In case you are wondering why you never experienced this bug before.)
The proper behavior is to recognize that the XML stanza isn't finished yet, and continue assembling until it is complete.
