mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-09 09:54:25 +09:00
Make function ssh_channel_accept() nonblocking if timeout is 0.
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
committed by
Andreas Schneider
parent
31fb4e1e69
commit
d904784489
@@ -2022,7 +2022,11 @@ static ssh_channel ssh_channel_accept(ssh_session session, int channeltype,
|
|||||||
* 50 ms. So we need to decrement by 100 ms.
|
* 50 ms. So we need to decrement by 100 ms.
|
||||||
*/
|
*/
|
||||||
for (t = timeout_ms; t >= 0; t -= 100) {
|
for (t = timeout_ms; t >= 0; t -= 100) {
|
||||||
ssh_handle_packets(session, 50);
|
if (timeout_ms == 0) {
|
||||||
|
ssh_handle_packets(session, 0);
|
||||||
|
} else {
|
||||||
|
ssh_handle_packets(session, 50);
|
||||||
|
}
|
||||||
|
|
||||||
if (session->ssh_message_list) {
|
if (session->ssh_message_list) {
|
||||||
iterator = ssh_list_get_iterator(session->ssh_message_list);
|
iterator = ssh_list_get_iterator(session->ssh_message_list);
|
||||||
|
|||||||
Reference in New Issue
Block a user