[PHP-CVS] cvs: php-src /main/streams streams.c xp_socket.c
dsp Mon Nov 24 15:35:03 2008 UTC Modified files: /php-src/main/streams streams.c xp_socket.c Log: Revert fix for 43782, as it caused problems. [DOC] We better document the issue at it is. http://cvs.php.net/viewvc.cgi/php-src/main/streams/streams.c?r1=1.174r2=1.175diff_format=u Index: php-src/main/streams/streams.c diff -u php-src/main/streams/streams.c:1.174 php-src/main/streams/streams.c:1.175 --- php-src/main/streams/streams.c:1.174Tue Nov 11 01:55:19 2008 +++ php-src/main/streams/streams.c Mon Nov 24 15:35:03 2008 @@ -19,7 +19,7 @@ +--+ */ -/* $Id: streams.c,v 1.174 2008/11/11 01:55:19 lbarnaud Exp $ */ +/* $Id: streams.c,v 1.175 2008/11/24 15:35:03 dsp Exp $ */ #define _GNU_SOURCE #include php.h @@ -840,7 +840,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, - -1, NULL)) { + 0, NULL)) { stream-eof = 1; } http://cvs.php.net/viewvc.cgi/php-src/main/streams/xp_socket.c?r1=1.48r2=1.49diff_format=u Index: php-src/main/streams/xp_socket.c diff -u php-src/main/streams/xp_socket.c:1.48 php-src/main/streams/xp_socket.c:1.49 --- php-src/main/streams/xp_socket.c:1.48 Tue Aug 26 16:06:23 2008 +++ php-src/main/streams/xp_socket.cMon Nov 24 15:35:03 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: xp_socket.c,v 1.48 2008/08/26 16:06:23 dsp Exp $ */ +/* $Id: xp_socket.c,v 1.49 2008/11/24 15:35:03 dsp Exp $ */ #include php.h #include ext/standard/file.h @@ -280,12 +280,8 @@ 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; } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main/streams streams.c xp_socket.c
dsp Tue Aug 26 16:06:23 2008 UTC Modified files: /php-src/main/streams streams.c xp_socket.c Log: Fixed bug #43782 (feof() does not detect timeout on socket) # Poll returns 0 if it times out. # We check for 0 and use the user set timeout in set_options by passing -1. http://cvs.php.net/viewvc.cgi/php-src/main/streams/streams.c?r1=1.168r2=1.169diff_format=u Index: php-src/main/streams/streams.c diff -u php-src/main/streams/streams.c:1.168 php-src/main/streams/streams.c:1.169 --- php-src/main/streams/streams.c:1.168Wed Aug 6 09:03:36 2008 +++ php-src/main/streams/streams.c Tue Aug 26 16:06:23 2008 @@ -19,7 +19,7 @@ +--+ */ -/* $Id: streams.c,v 1.168 2008/08/06 09:03:36 tony2001 Exp $ */ +/* $Id: streams.c,v 1.169 2008/08/26 16:06:23 dsp Exp $ */ #define _GNU_SOURCE #include php.h @@ -831,7 +831,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.47r2=1.48diff_format=u Index: php-src/main/streams/xp_socket.c diff -u php-src/main/streams/xp_socket.c:1.47 php-src/main/streams/xp_socket.c:1.48 --- php-src/main/streams/xp_socket.c:1.47 Wed Jul 16 14:08:04 2008 +++ php-src/main/streams/xp_socket.cTue Aug 26 16:06:23 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: xp_socket.c,v 1.47 2008/07/16 14:08:04 jani Exp $ */ +/* $Id: xp_socket.c,v 1.48 2008/08/26 16:06:23 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