diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2009-06-05 15:05:10 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2009-06-05 15:05:10 +0000 |
commit | 1ddf6912449ca02e9cdd106f2c423117d6e2ea62 (patch) | |
tree | 1be09a807090fb2afbc54ad4e049325eb2159a90 /crypto/bio | |
parent | 78074baaddf30637cdd89cec16a75d749d72c895 (diff) |
Update from 1.0.0-stable.
Diffstat (limited to 'crypto/bio')
-rw-r--r-- | crypto/bio/bss_dgram.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/crypto/bio/bss_dgram.c b/crypto/bio/bss_dgram.c index 2e1a6fac33..027cdf943b 100644 --- a/crypto/bio/bss_dgram.c +++ b/crypto/bio/bss_dgram.c @@ -217,12 +217,19 @@ static void dgram_adjust_rcv_timeout(BIO *b) timeleft.tv_usec += 1000000; } + if (timeleft.tv_sec < 0) + { + timeleft.tv_sec = 0; + timeleft.tv_usec = 1; + } + /* Adjust socket timeout if next handhake message timer * will expire earlier. */ - if (data->socket_timeout.tv_sec < timeleft.tv_sec || + if ((data->socket_timeout.tv_sec == 0 && data->socket_timeout.tv_usec == 0) || + (data->socket_timeout.tv_sec > timeleft.tv_sec) || (data->socket_timeout.tv_sec == timeleft.tv_sec && - data->socket_timeout.tv_usec <= timeleft.tv_usec)) + data->socket_timeout.tv_usec >= timeleft.tv_usec)) { #ifdef OPENSSL_SYS_WINDOWS timeout = timeleft.tv_sec * 1000 + timeleft.tv_usec / 1000; |