mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-27 15:54:22 +02:00
upstream: consistently check packet_timeout_ms against 0; ok djm
OpenBSD-Commit-ID: e8fb8cb2c96c980f075069302534eaf830929928
This commit is contained in:
parent
31f1ee5496
commit
1ddf5682f3
10
packet.c
10
packet.c
@ -1,4 +1,4 @@
|
|||||||
/* $OpenBSD: packet.c,v 1.290 2020/01/30 07:20:05 djm Exp $ */
|
/* $OpenBSD: packet.c,v 1.291 2020/03/06 18:20:44 markus Exp $ */
|
||||||
/*
|
/*
|
||||||
* Author: Tatu Ylonen <ylo@cs.hut.fi>
|
* Author: Tatu Ylonen <ylo@cs.hut.fi>
|
||||||
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
|
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
|
||||||
@ -1365,7 +1365,7 @@ ssh_packet_read_seqnr(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p)
|
|||||||
}
|
}
|
||||||
/* Wait for some data to arrive. */
|
/* Wait for some data to arrive. */
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (state->packet_timeout_ms != -1) {
|
if (state->packet_timeout_ms > 0) {
|
||||||
ms_to_timeval(&timeout, ms_remain);
|
ms_to_timeval(&timeout, ms_remain);
|
||||||
monotime_tv(&start);
|
monotime_tv(&start);
|
||||||
}
|
}
|
||||||
@ -1377,7 +1377,7 @@ ssh_packet_read_seqnr(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p)
|
|||||||
r = SSH_ERR_SYSTEM_ERROR;
|
r = SSH_ERR_SYSTEM_ERROR;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
if (state->packet_timeout_ms == -1)
|
if (state->packet_timeout_ms <= 0)
|
||||||
continue;
|
continue;
|
||||||
ms_subtract_diff(&start, &ms_remain);
|
ms_subtract_diff(&start, &ms_remain);
|
||||||
if (ms_remain <= 0) {
|
if (ms_remain <= 0) {
|
||||||
@ -2014,7 +2014,7 @@ ssh_packet_write_wait(struct ssh *ssh)
|
|||||||
timeoutp = &timeout;
|
timeoutp = &timeout;
|
||||||
}
|
}
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (state->packet_timeout_ms != -1) {
|
if (state->packet_timeout_ms > 0) {
|
||||||
ms_to_timeval(&timeout, ms_remain);
|
ms_to_timeval(&timeout, ms_remain);
|
||||||
monotime_tv(&start);
|
monotime_tv(&start);
|
||||||
}
|
}
|
||||||
@ -2024,7 +2024,7 @@ ssh_packet_write_wait(struct ssh *ssh)
|
|||||||
if (errno != EAGAIN && errno != EINTR &&
|
if (errno != EAGAIN && errno != EINTR &&
|
||||||
errno != EWOULDBLOCK)
|
errno != EWOULDBLOCK)
|
||||||
break;
|
break;
|
||||||
if (state->packet_timeout_ms == -1)
|
if (state->packet_timeout_ms <= 0)
|
||||||
continue;
|
continue;
|
||||||
ms_subtract_diff(&start, &ms_remain);
|
ms_subtract_diff(&start, &ms_remain);
|
||||||
if (ms_remain <= 0) {
|
if (ms_remain <= 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user