diff options
author | Daniel Lowrey <rdlowrey@php.net> | 2015-01-27 13:22:47 -0500 |
---|---|---|
committer | Daniel Lowrey <rdlowrey@php.net> | 2015-01-27 13:22:47 -0500 |
commit | 4965fe7fb8c0fdc8a666bee37f46cad329fefe1f (patch) | |
tree | e31225f389ddd6c6e869e25a36eab3cb48bf2a22 | |
parent | 95142d901568963b3f9d0cf0d9782021bd83f35f (diff) | |
parent | 8302d658db17a8314b0e2f9c71e536ec42fd2dcd (diff) | |
download | php-git-4965fe7fb8c0fdc8a666bee37f46cad329fefe1f.tar.gz |
Merge https://github.com/bbroerman30/php-src into windows-ssl-timeout-fix
Conflicts:
ext/openssl/xp_ssl.c
-rw-r--r-- | ext/openssl/xp_ssl.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c index 0b83fb1678..fb37b03b8f 100644 --- a/ext/openssl/xp_ssl.c +++ b/ext/openssl/xp_ssl.c @@ -1829,10 +1829,13 @@ static size_t php_openssl_sockop_io(int read, php_stream *stream, char *buf, siz retry = handle_ssl_error(stream, nr_bytes, 0); /* If we get this (the above doesn't check) then we'll retry as well. */ - if (errno == EAGAIN && ( err == SSL_ERROR_WANT_READ || SSL_ERROR_WANT_WRITE ) ) { + if (errno == EAGAIN && err == SSL_ERROR_WANT_READ && read) { retry = 1; } - + if (errno == EAGAIN && SSL_ERROR_WANT_WRITE && read == 0) { + retry = 1; + } + /* Also, on reads, we may get this condition on an EOF. We should check properly. */ if (read) { stream->eof = (retry == 0 && errno != EAGAIN && !SSL_pending(sslsock->ssl_handle)); @@ -1868,9 +1871,10 @@ static size_t php_openssl_sockop_io(int read, php_stream *stream, char *buf, siz (POLLIN|POLLPRI) : (POLLOUT|POLLPRI), has_timeout ? &left_time : NULL); } } - /* Finally, we keep going until we got data, and an SSL_ERROR_NONE, unless we had an error. */ - } while (retry); + /* Finally, we keep going until we got data, and an SSL_ERROR_NONE, unless we had an error. */ + } while (retry); + /* Tell PHP if we read / wrote bytes. */ if (nr_bytes > 0) { php_stream_notify_progress_increment(PHP_STREAM_CONTEXT(stream), nr_bytes, 0); |