diff --git a/src/ChangeLog b/src/ChangeLog index 4c6ab208..001b62e2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,6 +1,7 @@ 2011-04-04 Giuseppe Scrivano * openssl.c [WINDOWS]: Include . + (openssl_read): Retry the read on SSL_ERROR_WANT_READ. * host.c [WINDOWS]: Include and . Suggested by: Ray Satiro . diff --git a/src/openssl.c b/src/openssl.c index 60e794f6..201d2459 100644 --- a/src/openssl.c +++ b/src/openssl.c @@ -261,8 +261,10 @@ openssl_read (int fd, char *buf, int bufsize, void *arg) do ret = SSL_read (conn, buf, bufsize); while (ret == -1 - && SSL_get_error (conn, ret) == SSL_ERROR_SYSCALL - && errno == EINTR); + && (SSL_get_error (conn, ret) == SSL_ERROR_WANT_READ + || (SSL_get_error (conn, ret) == SSL_ERROR_SYSCALL + && errno == EINTR))); + return ret; }