cvs: php-src(PHP_4_4) /main memory_streams.c

From: Date: Thu, 06 Oct 2005 21:35:30 +0000
Subject: cvs: php-src(PHP_4_4) /main memory_streams.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-34373@lists.php.net to get a copy of this message
helly Thu Oct 6 17:35:30 2005 EDT Modified files: (Branch: PHP_4_4) /php-src/main memory_streams.c Log: - MFH Fix issue (endless loop) with temp/memory streams http://cvs.php.net/diff.php/php-src/main/memory_streams.c?r1=1.20.2.2&r2=1.20.2.2.8.1&ty=u Index: php-src/main/memory_streams.c diff -u php-src/main/memory_streams.c:1.20.2.2 php-src/main/memory_streams.c:1.20.2.2.8.1 --- php-src/main/memory_streams.c:1.20.2.2 Tue Dec 31 11:26:11 2002 +++ php-src/main/memory_streams.c Thu Oct 6 17:35:29 2005 @@ -12,11 +12,12 @@ | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ - | Author: | - | Marcus Boerger <helly@php.net> | + | Author: Marcus Boerger <helly@php.net> | +----------------------------------------------------------------------+ */ +/* $Id: memory_streams.c,v 1.20.2.2.8.1 2005/10/06 21:35:29 helly Exp $ */ + #define _GNU_SOURCE #include "php.h" @@ -214,7 +215,6 @@ php_stream *stream; self = emalloc(sizeof(*self)); - assert(self != NULL); self->data = NULL; self->fpos = 0; self->fsize = 0; @@ -313,7 +313,13 @@ ts = stream->abstract; assert(ts != NULL); - return php_stream_read(ts->innerstream, buf, count); + size_t got = php_stream_read(ts->innerstream, buf, count); + + if (!got) { + stream->eof |= ts->innerstream->eof; + } + + return got; } /* }}} */ @@ -423,15 +429,15 @@ NULL /* set_option */ }; +/* }}} */ -/* {{{ */ +/* {{{ _php_stream_temp_create */ PHPAPI php_stream *_php_stream_temp_create(int mode, size_t max_memory_usage STREAMS_DC TSRMLS_DC) { php_stream_temp_data *self; php_stream *stream; self = ecalloc(1, sizeof(*self)); - assert(self != NULL); self->smax = max_memory_usage; self->mode = mode; stream = php_stream_alloc(&php_stream_temp_ops, self, 0, "r+b"); @@ -443,7 +449,7 @@ /* }}} */ -/* {{{ */ +/* {{{ _php_stream_temp_open */ PHPAPI php_stream *_php_stream_temp_open(int mode, size_t max_memory_usage, char *buf, size_t length STREAMS_DC TSRMLS_DC) { php_stream *stream; @@ -462,6 +468,7 @@ } /* }}} */ + /* * Local variables: * tab-width: 4

« previous php.cvs (#34373) next »