diff --git a/src/channel.c b/src/channel.c index 8d6fb0a..9e29492 100644 --- a/src/channel.c +++ b/src/channel.c @@ -2008,6 +2008,9 @@ _libssh2_channel_write(LIBSSH2_CHANNEL *channel, int stream_id, rc = _libssh2_transport_read(session); while (rc > 0); + if((rc < 0) && (rc != LIBSSH2_ERROR_EAGAIN)) + return rc; + if(channel->local.window_size <= 0) /* there's no room for data so we stop */ return (rc==LIBSSH2_ERROR_EAGAIN?rc:0);