From: Wez Furlong Date: Thu, 13 Feb 2003 01:17:45 +0000 (+0000) Subject: Fix for Bug #21815 (fpassthru ignored buffered data but then complained anyway) X-Git-Tag: RELEASE_0_5~1069 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b2b3596257eb2194fc6b91961602844da62bd5aa;p=php Fix for Bug #21815 (fpassthru ignored buffered data but then complained anyway) --- diff --git a/main/streams.c b/main/streams.c index 3d67b4a3f2..5413bc8f79 100755 --- a/main/streams.c +++ b/main/streams.c @@ -1029,6 +1029,7 @@ PHPAPI size_t _php_stream_passthru(php_stream * stream STREAMS_DC TSRMLS_DC) #ifdef HAVE_MMAP if (!php_stream_is(stream, PHP_STREAM_IS_SOCKET) && stream->filterhead == NULL + && php_stream_tell(stream) == 0 && SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD, (void*)&fd, 0)) { struct stat sbuf; @@ -2047,7 +2048,7 @@ exit_success: * know that they should try something else */ php_error_docref(NULL TSRMLS_CC, E_WARNING, - "%d bytes of buffered data lost during conversion to FILE*!", + "%d bytes of buffered data lost during conversion!", stream->writepos - stream->readpos); }