libssh2_packet_read() was checking the "errno" even when recv() didn't

return an error.  "errno" should have been zero by the recv() call but
doesn't seem to be on all systems.  Only check when recv() says there
is an error.

Bug:		1703467
Patch:		1703468
This commit is contained in:
James Housley 2007-06-06 10:13:30 +00:00
parent 412b25d971
commit 9896c291e4

View File

@ -312,7 +312,7 @@ libssh2pack_t libssh2_packet_read(LIBSSH2_SESSION *session)
/* check if this is due to EAGAIN and return
the special return code if so, error out
normally otherwise */
if(errno == EAGAIN) {
if ((nread < 0) && (errno == EAGAIN)) {
return PACKET_EAGAIN;
}
return PACKET_FAIL;