mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
openssl: Retry to read if a non-blocking socket returns immediately.
This commit is contained in:
parent
4d564bd630
commit
6dca252c60
@ -1,6 +1,7 @@
|
||||
2011-04-04 Giuseppe Scrivano <gscrivano@gnu.org>
|
||||
|
||||
* openssl.c [WINDOWS]: Include <w32sock.h>.
|
||||
(openssl_read): Retry the read on SSL_ERROR_WANT_READ.
|
||||
|
||||
* host.c [WINDOWS]: Include <winsock2.h> and <ws2tcpip.h>.
|
||||
Suggested by: Ray Satiro <raysatiro@yahoo.com>.
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user