mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 18:50:28 +09:00
channels: Fix a possible infinite loop if the connection dropped.
This fixes bug #85.
This commit is contained in:
@@ -1233,7 +1233,9 @@ int channel_write_common(ssh_channel channel, const void *data,
|
|||||||
/* it's a good idea to flush the socket now */
|
/* it's a good idea to flush the socket now */
|
||||||
do {
|
do {
|
||||||
rc = ssh_handle_packets(session, timeout);
|
rc = ssh_handle_packets(session, timeout);
|
||||||
} while(ssh_socket_buffered_write_bytes(session->socket) > 0 && timeout != 0);
|
} while(rc == SSH_OK &&
|
||||||
|
timeout != 0 &&
|
||||||
|
ssh_socket_buffered_write_bytes(session->socket) > 0);
|
||||||
out:
|
out:
|
||||||
leave_function();
|
leave_function();
|
||||||
return (int)(origlen - len);
|
return (int)(origlen - len);
|
||||||
|
|||||||
Reference in New Issue
Block a user