mirror of
				https://github.com/libssh2/libssh2.git
				synced 2025-11-03 22:13:11 +03:00 
			
		
		
		
	- (Feb 12 2009) Romain Bondue extended Markus Moeller fix from Feb 8, based on
a previous (uncommitted) patch by Erik Brossler. It improves libssh2_channel_write_ex in blocking situations when the socket is set non- blocking.
This commit is contained in:
		
							
								
								
									
										10
									
								
								NEWS
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								NEWS
									
									
									
									
									
								
							@@ -1,7 +1,11 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
- (Deb 8 2009)
 | 
					- (Feb 12 2009) Romain Bondue extended Markus Moeller fix from Feb 8, based on
 | 
				
			||||||
  Markus Moeller fixed a flaw in libssh2_channel_write_ex() that would occur
 | 
					  a previous (uncommitted) patch by Erik Brossler. It improves
 | 
				
			||||||
  on EAGAIN situations.
 | 
					  libssh2_channel_write_ex in blocking situations when the socket is set non-
 | 
				
			||||||
 | 
					  blocking.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- (Feb 8 2009) Markus Moeller fixed a flaw in libssh2_channel_write_ex() that
 | 
				
			||||||
 | 
					  would occur on EAGAIN situations.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Version 1.0 ( )
 | 
					Version 1.0 ( )
 | 
				
			||||||
-------------------------------
 | 
					-------------------------------
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1771,8 +1771,9 @@ libssh2_channel_write_ex(LIBSSH2_CHANNEL * channel, int stream_id,
 | 
				
			|||||||
        channel->write_state = libssh2_NB_state_allocated;
 | 
					        channel->write_state = libssh2_NB_state_allocated;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /* deduct the amount thet has already been sent */
 | 
					    /* Deduct the amount that has already been sent, and set buf accordingly. */
 | 
				
			||||||
    buflen -= channel->write_bufwrote;
 | 
					    buflen -= channel->write_bufwrote;
 | 
				
			||||||
 | 
					    buf += channel->write_bufwrote;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    while (buflen > 0) {
 | 
					    while (buflen > 0) {
 | 
				
			||||||
        if (channel->write_state == libssh2_NB_state_allocated) {
 | 
					        if (channel->write_state == libssh2_NB_state_allocated) {
 | 
				
			||||||
@@ -1798,6 +1799,7 @@ libssh2_channel_write_ex(LIBSSH2_CHANNEL * channel, int stream_id,
 | 
				
			|||||||
                if (rc < 0) {
 | 
					                if (rc < 0) {
 | 
				
			||||||
                    /* Error or EAGAIN occurred, disconnect? */
 | 
					                    /* Error or EAGAIN occurred, disconnect? */
 | 
				
			||||||
                    if (rc != PACKET_EAGAIN) {
 | 
					                    if (rc != PACKET_EAGAIN) {
 | 
				
			||||||
 | 
					                        LIBSSH2_FREE(session, channel->write_packet);
 | 
				
			||||||
                        channel->write_state = libssh2_NB_state_idle;
 | 
					                        channel->write_state = libssh2_NB_state_idle;
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    return rc;
 | 
					                    return rc;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user