mirror of
				https://github.com/libssh2/libssh2.git
				synced 2025-11-03 22:13:11 +03:00 
			
		
		
		
	channel_write: acknowledge transport errors
When draining data off the socket with _libssh2_transport_read() (which in turn has to be done so that we can be sure to have read any possible window-increasing packets), this code previously ignored errors which could lead to nasty loops. Now all error codes except EAGAIN will cause the error to be returned at once. Bug: http://www.libssh2.org/mail/libssh2-devel-archive-2012-03/0068.shtml Reported by: Matthew Booth
This commit is contained in:
		@@ -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);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user