diff options
author | Matthias Andree <matthias.andree@gmx.de> | 2021-11-20 16:42:16 +0100 |
---|---|---|
committer | Matthias Andree <matthias.andree@gmx.de> | 2021-11-21 00:33:34 +0100 |
commit | 0d32056e7b14bd029aa375f59230a3ad3e2bae51 (patch) | |
tree | d1775297b4072a5035a463021a2d9f62492708f8 | |
parent | cc5c80eb4d6f98b94f20e5abd4cd50c5bf0e5a44 (diff) | |
download | fetchmail-0d32056e7b14bd029aa375f59230a3ad3e2bae51.tar.gz fetchmail-0d32056e7b14bd029aa375f59230a3ad3e2bae51.tar.bz2 fetchmail-0d32056e7b14bd029aa375f59230a3ad3e2bae51.zip |
wolfSSL: workaround 5.0.0 SSL_peek() not truly blocking.
SSL_peek() may return 0 on blocking I/O with SSL_get_error() returning
SSL_ERROR_WANT_READ. This should not occur on blocking I/O, and does
not occur with OpenSSL 1.0.2, 1.1.1, 3.0.
This caused a socket error right after SSL negotiation.
-rw-r--r-- | socket.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -521,7 +521,8 @@ int SockRead(int sock, char *buf, int len) /* SSL_peek says no data... Does he mean no data or did the connection blow up? If we got an error then bail! */ - if (0 != SSL_get_error(ssl, n)) { + int r = SSL_get_error(ssl, n); + if (r != 0 && r != SSL_ERROR_WANT_READ) { return -1; } /* We didn't get an error so read at least one |