1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

openssl: make openssl_peek non-blocking.

This commit is contained in:
Giuseppe Scrivano 2011-04-13 13:57:37 +02:00
parent cbe8eb725b
commit b0a3d43014
2 changed files with 10 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2011-04-13 Giuseppe Scrivano <gscrivano@gnu.org>
* openssl.c (openssl_poll): Check if the specified timeout is zero after
SSL_pending.
(openssl_peek): Make the call non-blocking.
2011-04-11 Cristian Rodríguez <crrodriguez@opensuse.org> (tiny change)
* openssl.c (ssl_init) [! OPENSSL_NO_SSL2]: Use SSLv2 only when

View File

@ -289,10 +289,10 @@ openssl_poll (int fd, double timeout, int wait_for, void *arg)
{
struct openssl_transport_context *ctx = arg;
SSL *conn = ctx->conn;
if (timeout == 0)
return 1;
if (SSL_pending (conn))
return 1;
if (timeout == 0)
return 1;
return select_fd (fd, timeout, wait_for);
}
@ -302,6 +302,8 @@ openssl_peek (int fd, char *buf, int bufsize, void *arg)
int ret;
struct openssl_transport_context *ctx = arg;
SSL *conn = ctx->conn;
if (! openssl_poll (fd, 0.0, WAIT_FOR_READ, arg))
return 0;
do
ret = SSL_peek (conn, buf, bufsize);
while (ret == -1