Ticket #2634 (reopened defect)

Opened 4 years ago

Last modified 11 months ago

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.

Attachments

Change History

Changed 20 months ago by steve-e

  • status changed from new to closed
  • resolution set to fixed
  • milestone set to 0.13

(In [16dc2fdd833757cb19da0b091715763133efcb04]) Proposed Fix. Make sure we read all data from our SSL socket wrappers and don't just rely on gobject.io_add_watch, select or poll.

This isn't really a clean solution, but the less intrusives fix that I can think of. Fixes #2634.

Changed 20 months ago by steve-e

  • status changed from closed to reopened
  • os set to All
  • resolution fixed deleted

How can we solve that for GObjectIdleQueue?

Changed 20 months ago by Sven

I'm getting Tracebacks when Gajim tries to connect a Server whiche hasn't running a jabber server. I suppose it's related to this recent changes, so I post it here:

sven@T60:/opt/gajim$ ./launch.sh 
===============================================================================
libasyncns-python not installed which means:
 - nslookup will be used for SRV and TXT requests
 - getaddrinfo will block
libasyncns-python can be found at https://launchpad.net/libasyncns-python
===============================================================================
gajim.LANG: de
2009-01-03 14:38:31,357 gajim.c.x.transports_nb: ERROR: Connection to 1.2.3.4:5222 lost: 111 Connection refused
Traceback (most recent call last):
  File "/opt/gajim/src/common/xmpp/transports_nb.py", line 507, in _do_receive
    received = self._recv(RECV_BUFSIZE)
error: (111, 'Connection refused')
2009-01-03 14:38:31,359 gajim.c.x.transports_nb: ERROR: Error while disconnecting socket: Transport endpoint is not connected
2009-01-03 14:38:31,582 gajim.c.x.tls_nb: ERROR: Error while TLS handshake: 
Traceback (most recent call last):
  File "/opt/gajim/src/common/xmpp/tls_nb.py", line 354, in _startSSL_pyOpenSSL
    tcpsock._sslObj.do_handshake()
SysCallError: (111, 'Connection refused')
2009-01-03 14:38:31,583 gajim.c.x.transports_nb: ERROR: Error while disconnecting socket: Transport endpoint is not connected
2009-01-03 14:38:31,969 gajim.c.x.transports_nb: ERROR: Connection to 1.2.3.4:5222 lost: 111 Connection refused
Traceback (most recent call last):
  File "/opt/gajim/src/common/xmpp/transports_nb.py", line 507, in _do_receive
    received = self._recv(RECV_BUFSIZE)
error: (111, 'Connection refused')
2009-01-03 14:38:31,970 gajim.c.x.transports_nb: ERROR: Error while disconnecting socket: Transport endpoint is not connected

Changed 11 months ago by asterix

  • milestone 0.13 deleted

Add/Change #2634 (Gajim fails to assemble partial data)

Author


E-mail address and user name can be saved in the Preferences.


Change Properties
<Author field>
Action
as reopened
as The resolution will be set. Next status will be 'closed'
to The owner will change from dkirov. Next status will be 'new'
Next status will be 'needinfo'
 
Note: See TracTickets for help on using tickets.