cvs: php4 /main streams.c
| From: | Wez Furlong | Date: | Sat, 12 Oct 2002 02:56:34 +0000 |
| Subject: | cvs: php4 /main streams.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-14863@lists.php.net to get a copy of this message | ||
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;