php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #67292
Patch main_streams_xp_socket_eof revision 2014-05-19 14:19 UTC by ghpille at hotmail dot com

Patch main_streams_xp_socket_eof for SOAP related Bug #67292

Patch version 2014-05-19 14:19 UTC

Return to Bug #67292 | Download this patch
Patch Revisions:

Developer: ghpille@hotmail.com

--- php5.4-201405161030/main/streams/xp_socket.c	2014-04-02 12:43:38.000000000 +0200
+++ php5.4/main/streams/xp_socket.c	2014-05-19 16:12:35.020152916 +0200
@@ -277,6 +277,7 @@
 				struct timeval tv;
 				char buf;
 				int alive = 1;
+				int res = 0;
 
 				if (value == -1) {
 					if (sock->timeout.tv_sec == -1) {
@@ -293,7 +294,11 @@
 				if (sock->socket == -1) {
 					alive = 0;
 				} else if (php_pollfd_for(sock->socket, PHP_POLLREADABLE|POLLPRI, &tv) > 0) {
-					if (0 >= recv(sock->socket, &buf, sizeof(buf), MSG_PEEK) && php_socket_errno() != EWOULDBLOCK) {
+					res = recv(sock->socket, &buf, sizeof(buf), MSG_PEEK);
+					if (0 == res) {
+						alive = 0;
+					}
+					if (0 >= res && php_socket_errno() != EWOULDBLOCK) {
 						alive = 0;
 					}
 				}
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 23:01:29 2024 UTC