From 6686c41e3d31e392cae7558206b6e8c6fdeb3e26 Mon Sep 17 00:00:00 2001 From: David Soria Parra Date: Mon, 24 Nov 2008 15:37:33 +0000 Subject: [PATCH] MFH: Revert fix for 43782, as it caused problems. --- NEWS | 1 - main/streams/streams.c | 2 +- main/streams/xp_socket.c | 8 ++------ 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/NEWS b/NEWS index 34b84f1534..d37db7a866 100644 --- a/NEWS +++ b/NEWS @@ -269,7 +269,6 @@ PHP NEWS overlapping needles). (Moriyoshi) - Fixed Bug #43958 (class name added into the error message). (Dmitry) - Fixed bug #43941 (json_encode silently cuts non-UTF8 strings). (Stas) -- Fixed bug #43782 (feof() does not detect timeout on socket). (David Soria Parra) - Fixed bug #43668 (Added odbc.default_cursortype to control the ODBC cursormodel). (Patrick) - Fixed bug #43666 (Fixed code to use ODBC 3.52 datatypes for 64bit systems). diff --git a/main/streams/streams.c b/main/streams/streams.c index 747aa4b918..01f6f6e1c4 100755 --- a/main/streams/streams.c +++ b/main/streams/streams.c @@ -641,7 +641,7 @@ PHPAPI int _php_stream_eof(php_stream *stream TSRMLS_DC) /* use the configured timeout when checking eof */ if (!stream->eof && PHP_STREAM_OPTION_RETURN_ERR == php_stream_set_option(stream, PHP_STREAM_OPTION_CHECK_LIVENESS, - -1, NULL)) { + 0, NULL)) { stream->eof = 1; } diff --git a/main/streams/xp_socket.c b/main/streams/xp_socket.c index e181feb94b..5e074a0ca0 100644 --- a/main/streams/xp_socket.c +++ b/main/streams/xp_socket.c @@ -280,12 +280,8 @@ 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() != EAGAIN) { - alive = 0; - } - } else { + } 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() != EAGAIN) { alive = 0; } } -- 2.40.0