diff --git a/NEWS b/NEWS index ebf82ed1be6..39eec5e74b9 100644 --- a/NEWS +++ b/NEWS @@ -75,6 +75,10 @@ PHP NEWS . Partially fixed bug GH-16317 (SimpleXML does not allow __debugInfo() overrides to work). (nielsdos) +- Streams: + . Fixed bug GH-19798: XP_SOCKET XP_SSL (Socket stream modules): Incorrect + condition for Win32/Win64. (Jakub Zelenka) + - Tidy: . Fixed GH-19021 (improved tidyOptGetCategory detection). (arjendekorte, David Carlier, Peter Kokot) diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c index a320db09f66..b576204b7d0 100644 --- a/ext/openssl/xp_ssl.c +++ b/ext/openssl/xp_ssl.c @@ -2338,7 +2338,7 @@ static int php_openssl_sockop_stat(php_stream *stream, php_stream_statbuf *ssb) static inline int php_openssl_tcp_sockop_accept(php_stream *stream, php_openssl_netstream_data_t *sock, php_stream_xport_param *xparam STREAMS_DC) /* {{{ */ { - int clisock; + php_socket_t clisock; bool nodelay = 0; zval *tmpzval = NULL; @@ -2359,7 +2359,7 @@ static inline int php_openssl_tcp_sockop_accept(php_stream *stream, php_openssl_ &xparam->outputs.error_code, nodelay); - if (clisock >= 0) { + if (clisock != SOCK_ERR) { php_openssl_netstream_data_t *clisockdata = (php_openssl_netstream_data_t*) emalloc(sizeof(*clisockdata)); /* copy underlying tcp fields */ diff --git a/main/streams/xp_socket.c b/main/streams/xp_socket.c index 2178e0a39e9..d8a3d01ffad 100644 --- a/main/streams/xp_socket.c +++ b/main/streams/xp_socket.c @@ -858,7 +858,7 @@ out: static inline int php_tcp_sockop_accept(php_stream *stream, php_netstream_data_t *sock, php_stream_xport_param *xparam STREAMS_DC) { - int clisock; + php_socket_t clisock; bool nodelay = 0; zval *tmpzval = NULL; @@ -879,7 +879,7 @@ static inline int php_tcp_sockop_accept(php_stream *stream, php_netstream_data_t &xparam->outputs.error_code, nodelay); - if (clisock >= 0) { + if (clisock != SOCK_ERR) { php_netstream_data_t *clisockdata = (php_netstream_data_t*) emalloc(sizeof(*clisockdata)); memcpy(clisockdata, sock, sizeof(*clisockdata));