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

main/streams/xp_socket.c

index 57e1b5af9b96746a6dbf0981c4b91997ad425956..cd1367923b5d8d93aca5bedcec0c7364e93b7a2f 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;
                                        }
                                }