Subject: [libssh2] bug in transport.c (and a one-line fix)

[libssh2] bug in transport.c (and a one-line fix)

From: Gutjahr, Troy <>
Date: Tue, 5 Jun 2007 17:28:01 -0500

In the latest version (1.7) of transport.c, there is a bug at line 315.
It should be changed from

if(errno == EAGAIN) {


if(nread == -1 && errno == EAGAIN) {

The call to recv() at line 308 is returning 0 bytes when I'm shutting
down my sftp channel. Without my change, libssh2_packet_read is
erroneously returning PACKET_EGAIN. This causes an endless loop in
libssh2_channel_close because it repeatedly calls libssh2_packet_read
when the return value is PACKET_EAGAIN.

Would someone care to add this change in CVS? I don't have access. If it
looks like I'm likely to contribute more than a couple of simple
changes, maybe I'll take the plunge and request CVS access.


-- Troy Gutjahr
The information contained in this message may be privileged
and confidential and protected from disclosure. If the reader
of this message is not the intended recipient, or an employee
or agent responsible for delivering this message to the
intended recipient, you are hereby notified that any reproduction,
dissemination or distribution of this communication is strictly
prohibited. If you have received this communication in error,
please notify us immediately by replying to the message and
deleting it from your computer. Thank you. Tellabs

This email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
libssh2-devel mailing list
Received on 2007-06-06