From a87a39d05f070dda823953a0c90a447bb755b73f Mon Sep 17 00:00:00 2001 From: Roelof duToit Date: Thu, 13 Jul 2017 14:09:19 -0400 Subject: [PATCH] Update PR#3925 Reviewed-by: Tim Hudson Reviewed-by: Bernd Edlinger Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/3925) --- apps/s_time.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/s_time.c b/apps/s_time.c index 6976c3ce9c..cf9ed4571d 100644 --- a/apps/s_time.c +++ b/apps/s_time.c @@ -240,7 +240,9 @@ int s_time_main(int argc, char **argv) www_path); if (buf_len <= 0 || SSL_write(scon, buf, buf_len) <= 0) goto end; - while ((i = SSL_read(scon, buf, sizeof(buf))) > 0 || SSL_get_error(scon, i) == SSL_ERROR_WANT_READ) + while ((i = SSL_read(scon, buf, sizeof(buf))) > 0 || + SSL_get_error(scon, i) == SSL_ERROR_WANT_READ || + SSL_get_error(scon, i) == SSL_ERROR_WANT_WRITE) if (i > 0) bytes_read += i; } #ifdef NO_SHUTDOWN @@ -297,7 +299,9 @@ int s_time_main(int argc, char **argv) buf_len = BIO_snprintf(buf, sizeof(buf), fmt_http_get_cmd, www_path); if (buf_len <= 0 || SSL_write(scon, buf, buf_len) <= 0) goto end; - while ((i = SSL_read(scon, buf, sizeof(buf))) > 0 || SSL_get_error(scon, i) == SSL_ERROR_WANT_READ) + while ((i = SSL_read(scon, buf, sizeof(buf))) > 0 || + SSL_get_error(scon, i) == SSL_ERROR_WANT_READ || + SSL_get_error(scon, i) == SSL_ERROR_WANT_WRITE) continue; } #ifdef NO_SHUTDOWN @@ -328,7 +332,9 @@ int s_time_main(int argc, char **argv) www_path); if (buf_len <= 0 || SSL_write(scon, buf, buf_len) <= 0) goto end; - while ((i = SSL_read(scon, buf, sizeof(buf))) > 0 || SSL_get_error(scon, i) == SSL_ERROR_WANT_READ) + while ((i = SSL_read(scon, buf, sizeof(buf))) > 0 || + SSL_get_error(scon, i) == SSL_ERROR_WANT_READ || + SSL_get_error(scon, i) == SSL_ERROR_WANT_WRITE) if (i > 0) bytes_read += i; } #ifdef NO_SHUTDOWN -- 2.25.1