_libssh2_channel_read: store last error
When the transport layer returns EAGAIN this function didn't call _libssh2_error() which made the last_error not get set.
This commit is contained in:
parent
691cabc048
commit
2db4863e6e
@ -1,6 +1,6 @@
|
|||||||
/* Copyright (c) 2004-2007 Sara Golemon <sarag@libssh2.org>
|
/* Copyright (c) 2004-2007 Sara Golemon <sarag@libssh2.org>
|
||||||
* Copyright (c) 2005 Mikhail Gusarov <dottedmag@dottedmag.net>
|
* Copyright (c) 2005 Mikhail Gusarov <dottedmag@dottedmag.net>
|
||||||
* Copyright (c) 2008-2010 by Daniel Stenberg
|
* Copyright (c) 2008-2011 by Daniel Stenberg
|
||||||
*
|
*
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
@ -1532,6 +1532,7 @@ libssh2_channel_get_exit_signal(LIBSSH2_CHANNEL *channel,
|
|||||||
* to be adjusted is less than LIBSSH2_CHANNEL_MINADJUST and force is 0 the
|
* to be adjusted is less than LIBSSH2_CHANNEL_MINADJUST and force is 0 the
|
||||||
* adjustment amount will be queued for a later packet.
|
* adjustment amount will be queued for a later packet.
|
||||||
*
|
*
|
||||||
|
* Calls _libssh2_error() !
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
_libssh2_channel_receive_window_adjust(LIBSSH2_CHANNEL * channel,
|
_libssh2_channel_receive_window_adjust(LIBSSH2_CHANNEL * channel,
|
||||||
@ -1858,9 +1859,11 @@ ssize_t _libssh2_channel_read(LIBSSH2_CHANNEL *channel, int stream_id,
|
|||||||
return code. */
|
return code. */
|
||||||
if(channel->remote.eof || channel->remote.close)
|
if(channel->remote.eof || channel->remote.close)
|
||||||
return 0;
|
return 0;
|
||||||
else
|
else if(rc != LIBSSH2_ERROR_EAGAIN)
|
||||||
|
return 0;
|
||||||
|
|
||||||
/* if the transport layer said EAGAIN then we say so as well */
|
/* if the transport layer said EAGAIN then we say so as well */
|
||||||
return (rc == LIBSSH2_ERROR_EAGAIN)?rc:0;
|
return _libssh2_error(session, rc, "would block");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
/* make sure we remain in the created state to focus on emptying the
|
/* make sure we remain in the created state to focus on emptying the
|
||||||
|
Loading…
x
Reference in New Issue
Block a user