dsp             Wed Aug 27 07:48:37 2008 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src    NEWS 
    /php-src/main/streams       streams.c xp_socket.c 
  Log:
  MFH: Fixed bug #43782 (feof() does not detect timeout on socket)
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1206&r2=1.2027.2.547.2.1207&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.1206 php-src/NEWS:1.2027.2.547.2.1207
--- php-src/NEWS:1.2027.2.547.2.1206    Fri Aug 22 01:06:54 2008
+++ php-src/NEWS        Wed Aug 27 07:48:36 2008
@@ -86,6 +86,7 @@
 - Fixed bug #43993 (mb_substr_count() behaves differently to substr_count() 
with
   overlapping needles). (Moriyoshi)
 - 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 #42737 (preg_split('//u') triggers a E_NOTICE with newlines).
   (Nuno)
 - Fixed bug #42604 ("make test" fails with --with-config-file-scan-dir=path).
http://cvs.php.net/viewvc.cgi/php-src/main/streams/streams.c?r1=1.82.2.6.2.24&r2=1.82.2.6.2.25&diff_format=u
Index: php-src/main/streams/streams.c
diff -u php-src/main/streams/streams.c:1.82.2.6.2.24 
php-src/main/streams/streams.c:1.82.2.6.2.25
--- php-src/main/streams/streams.c:1.82.2.6.2.24        Tue Jul 15 16:10:32 2008
+++ php-src/main/streams/streams.c      Wed Aug 27 07:48:37 2008
@@ -19,7 +19,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: streams.c,v 1.82.2.6.2.24 2008/07/15 16:10:32 jani Exp $ */
+/* $Id: streams.c,v 1.82.2.6.2.25 2008/08/27 07:48:37 dsp Exp $ */
 
 #define _GNU_SOURCE
 #include "php.h"
@@ -633,7 +633,7 @@
        /* 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,
-                       0, NULL)) {
+                       -1, NULL)) {
                stream->eof = 1;
        }
 
http://cvs.php.net/viewvc.cgi/php-src/main/streams/xp_socket.c?r1=1.33.2.2.2.10&r2=1.33.2.2.2.11&diff_format=u
Index: php-src/main/streams/xp_socket.c
diff -u php-src/main/streams/xp_socket.c:1.33.2.2.2.10 
php-src/main/streams/xp_socket.c:1.33.2.2.2.11
--- php-src/main/streams/xp_socket.c:1.33.2.2.2.10      Wed Jul 16 14:10:50 2008
+++ php-src/main/streams/xp_socket.c    Wed Aug 27 07:48:37 2008
@@ -16,7 +16,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: xp_socket.c,v 1.33.2.2.2.10 2008/07/16 14:10:50 jani Exp $ */
+/* $Id: xp_socket.c,v 1.33.2.2.2.11 2008/08/27 07:48:37 dsp Exp $ */
 
 #include "php.h"
 #include "ext/standard/file.h"
@@ -280,8 +280,12 @@
 
                                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) {
+                               } 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 {
                                                alive = 0;
                                        }
                                }



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to