1
0
mirror of https://github.com/php/php-src.git synced 2026-03-27 01:32:22 +01:00

MFB52: Fixed bug #44874 (dead pfsockopen'ed sockets aren't reaped when the

remote end restarts)

# Patch by Richard dot Krehbiel at gmail dot com
This commit is contained in:
Ilia Alshanetsky
2009-02-08 16:54:43 +00:00
parent 0136b5cec6
commit fcc80dcb86

View 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;
}
}