Skip to content

Commit 0e15056

Browse files
committed
Fix feof hanging on TLS streams (bug #77390)
1 parent 20de58f commit 0e15056

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

ext/openssl/xp_ssl.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2413,13 +2413,12 @@ static int php_openssl_sockop_set_option(php_stream *stream, int option, int val
24132413
int err = SSL_get_error(sslsock->ssl_handle, n);
24142414

24152415
if (err == SSL_ERROR_SYSCALL) {
2416-
alive = php_socket_errno() == EAGAIN;
2416+
alive = n == -1 && php_socket_errno() == EAGAIN;
24172417
break;
24182418
}
24192419

24202420
if (err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE) {
2421-
/* re-negotiate */
2422-
continue;
2421+
break;
24232422
}
24242423

24252424
/* any other problem is a fatal error */

0 commit comments

Comments
 (0)