wez Fri Oct 11 22:56:34 2002 EDT Modified files: /php4/main streams.c Log: paranoia Index: php4/main/streams.c diff -u php4/main/streams.c:1.100 php4/main/streams.c:1.101 --- php4/main/streams.c:1.100 Fri Oct 11 22:31:42 2002 +++ php4/main/streams.c Fri Oct 11 22:56:34 2002 @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: streams.c,v 1.100 2002/10/12 02:31:42 wez Exp $ */ +/* $Id: streams.c,v 1.101 2002/10/12 02:56:34 wez Exp $ */ #define _GNU_SOURCE #include "php.h" @@ -464,6 +464,9 @@ /* is there enough data in the buffer ? */ if (stream->writepos - stream->readpos < (off_t)size) { size_t justread = 0; + + if (stream->eof) + return; /* no; so lets fetch more data */ @@ -522,7 +525,7 @@ didread += toread; } - if (size == 0) { + if (size == 0 || stream->eof) { break; } @@ -721,6 +724,8 @@ if (done) { break; } + } else if (stream->eof) { + break; } else { /* XXX: Should be fine to always read chunk_size */ size_t toread = maxlen - 1;
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php