Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions ext/openssl/xp_ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2399,10 +2399,11 @@ static int php_openssl_sockop_set_option(php_stream *stream, int option, int val

if (sslsock->s.socket == -1) {
alive = 0;
} else if ((!sslsock->ssl_active && value == 0 && (MSG_DONTWAIT || !sslsock->s.is_blocked)) ||
} else if ((value == 0 && ((!sslsock->ssl_active && MSG_DONTWAIT) || !sslsock->s.is_blocked)) ||
php_pollfd_for(sslsock->s.socket, PHP_POLLREADABLE|POLLPRI, &tv) > 0) {
/* the poll() call was skipped if the socket is non-blocking (or MSG_DONTWAIT is available) and if the timeout is zero */
/* additionally, we don't use this optimization if SSL is active because in that case, we're not using MSG_DONTWAIT */
/* The poll() call is skipped if the socket is non-blocking (or MSG_DONTWAIT is available)
* and if the timeout is zero. Additionally for blocking socket we don't use this
* optimization if SSL is active because in that case we're not using MSG_DONTWAIT. */
if (sslsock->ssl_active) {
int n = SSL_peek(sslsock->ssl_handle, &buf, sizeof(buf));
if (n <= 0) {
Expand Down