]> granicus.if.org Git - php/commitdiff
MFB52: Fixed bug #44874 (dead pfsockopen'ed sockets aren't reaped when the
authorIlia Alshanetsky <iliaa@php.net>
Sun, 8 Feb 2009 16:54:43 +0000 (16:54 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Sun, 8 Feb 2009 16:54:43 +0000 (16:54 +0000)
remote end restarts)

# Patch by Richard dot Krehbiel at gmail dot com

main/streams/xp_socket.c

index eee8a7a5c45b8b7b72a9d0b14bc22984ca2070dd..aecc425ba1b9e23fbd804f73b0049130834dca1e 100644 (file)
@@ -281,7 +281,7 @@ static int php_sockop_set_option(php_stream *stream, int option, int value, void
                                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) {
+                                       if (0 >= recv(sock->socket, &buf, sizeof(buf), MSG_PEEK) && php_socket_errno() != EWOULDBLOCK) {
                                                alive = 0;
                                        }
                                }