Why didn't you bother fixing this in the PHP_5_2 (a.k.a. bugfix branch)
at all? Too much work?
.oO(Why, do, I, have, to, ask, this, every, single time..?)
--Jani
David Soria Parra wrote:
dsp Tue Aug 26 16:06:37 2008 UTC
Modified files: (Branch: PHP_5_3)
/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.965.2.287&r2=1.2027.2.547.2.965.2.288&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.965.2.287
php-src/NEWS:1.2027.2.547.2.965.2.288
--- php-src/NEWS:1.2027.2.547.2.965.2.287 Tue Aug 26 09:56:08 2008
+++ php-src/NEWSTue Aug 26 16:06:36 2008
@@ -50,6 +50,7 @@
duplicate keys). (Dmitry)
- Fixed bug #43817 (opendir() fails on Windows directories with parent
directory unaccessible). (Dmitry)
+- Fixed bug #43782 (feof() does not detect timeout on socket). (David Soria
Parra)
- Fixed bug #43008 (php://filter uris ignore url encoded filternames and can't
handle slashes). (Arnaud)
- Fixed bug #35980 (touch() works on files but not on directories). (Pierre)
http://cvs.php.net/viewvc.cgi/php-src/main/streams/streams.c?r1=1.82.2.6.2.18.2.13&r2=1.82.2.6.2.18.2.14&diff_format=u
Index: php-src/main/streams/streams.c
diff -u php-src/main/streams/streams.c:1.82.2.6.2.18.2.13
php-src/main/streams/streams.c:1.82.2.6.2.18.2.14
--- php-src/main/streams/streams.c:1.82.2.6.2.18.2.13 Wed Aug 6 09:03:48 2008
+++ php-src/main/streams/streams.c Tue Aug 26 16:06:36 2008
@@ -19,7 +19,7 @@
+--+
*/
-/* $Id: streams.c,v 1.82.2.6.2.18.2.13 2008/08/06 09:03:48 tony2001 Exp $ */
+/* $Id: streams.c,v 1.82.2.6.2.18.2.14 2008/08/26 16:06:36 dsp Exp $ */
#define _GNU_SOURCE
#include "php.h"
@@ -642,7 +642,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.6.2.5&r2=1.33.2.2.2.6.2.6&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.6.2.5
php-src/main/streams/xp_socket.c:1.33.2.2.2.6.2.6
--- php-src/main/streams/xp_socket.c:1.33.2.2.2.6.2.5 Wed Jul 16 14:08:38 2008
+++ php-src/main/streams/xp_socket.cTue Aug 26 16:06:36 2008
@@ -16,7 +16,7 @@
+--+
*/
-/* $Id: xp_socket.c,v 1.33.2.2.2.6.2.5 2008/07/16 14:08:38 jani Exp $ */
+/* $Id: xp_socket.c,v 1.33.2.2.2.6.2.6 2008/08/26 16:06:36 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