diff options
Diffstat (limited to 'ext/openssl/xp_ssl.c')
-rw-r--r-- | ext/openssl/xp_ssl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c index ea29a34058..d79c325d02 100644 --- a/ext/openssl/xp_ssl.c +++ b/ext/openssl/xp_ssl.c @@ -1912,7 +1912,7 @@ static int php_openssl_enable_crypto(php_stream *stream, } timeout = sslsock->is_client ? &sslsock->connect_timeout : &sslsock->s.timeout; - has_timeout = !sslsock->s.is_blocked && (timeout->tv_sec || timeout->tv_usec); + has_timeout = !sslsock->s.is_blocked && (timeout->tv_sec > 0 || (timeout->tv_sec == 0 && timeout->tv_usec)); /* gettimeofday is not monotonic; using it here is not strictly correct */ if (has_timeout) { gettimeofday(&start_time, NULL); @@ -2064,7 +2064,7 @@ static size_t php_openssl_sockop_io(int read, php_stream *stream, char *buf, siz sslsock->s.is_blocked = 0; } - if (!sslsock->s.is_blocked && timeout && (timeout->tv_sec || timeout->tv_usec)) { + if (!sslsock->s.is_blocked && timeout && (timeout->tv_sec > 0 || (timeout->tv_sec == 0 && timeout->tv_usec))) { has_timeout = 1; /* gettimeofday is not monotonic; using it here is not strictly correct */ gettimeofday(&start_time, NULL); |