Subject: libssh2 hangs in channel_close()

libssh2 hangs in channel_close()

From: Daniel Stenberg <>
Date: Tue, 13 Apr 2010 09:53:37 +0200 (CEST)


The problem with the self test is the code in channel_close() that
unconditionally waits for the remote EOF to arrive. Quite clearly it is simply
not coming here, and thus libssh2 hangs there waiting for it.

This was introduced by Peter in commit

     Send and receive channel EOF before sending SSH_MSG_CHANNEL_CLOSE

     Sending SSH_MSG_CHANNEL_CLOSE without channel EOF is explicitly allowed
     in RFC 4254, but some non-conforming servers will hang or time out when
     the channel is closed before EOF.

     Other common clients send and receive EOF before closing, there are no
     drawbacks, and some servers need it to work correctly.

Is there really anything we can do about this? I mean, if we're about to close
the channel, we can't sit and waiting for an EOF that might not come!

Received on 2010-04-13