[Psi-devel] Q3Socket read bug

Norman Rasmussen norman at rasmussen.co.za
Sun Oct 22 12:40:55 PDT 2006


need to pass this one on to the Qt guys:

in src/qt3support/network/q3socket.cpp, Q3Socket::sn_read, line 1187:

    if ( nbytes <= 0 ) {			// connection closed?
	// On Windows this may happen when the connection is still open.
	// This happens when the system is heavily loaded and we have
	// read all the data on the socket before a new WSAAsyncSelect
	// event is processed. A new read operation would then block.
	// This code is also useful when Q3Socket is used without an
	// event loop.
	nread = d->socket->readBlock( buf, maxToRead ?
QMIN((Q_LONG)sizeof(buf),maxToRead) : sizeof(buf) );
	if ( nread == 0 ) {			// really closed
#if defined(Q3SOCKET_DEBUG)
	    qDebug( "Q3Socket (%s): sn_read: Connection closed", name() );
#endif
	    // ### we should rather ask the socket device if it is closed
	    d->connectionClosed();
	    emit connectionClosed();
	    Q3SocketPrivate::sn_read_alreadyCalled.removeRef( this );
	    return;

I'm seeing some 0 byte receptions from a ejabberd server, causing Psi
to disconnect.  If I set a breakpoint and skip the signal, everything
works fine.  Fetching large vcards can help cause this bug, also
initial presence causes it.  This ties in with the description at the
top, which is good.

-- 
- Norman Rasmussen
 - Email: norman at rasmussen.co.za
 - Home page: http://norman.rasmussen.co.za/


More information about the psi-devel mailing list