pollita Wed Feb 12 19:42:06 2003 EDT Modified files: (Branch: PHP_4_3) /php4/ext/standard http_fopen_wrapper.c Log: Reverting earlier patch to reintroduce buggy behavior (yes, you heard that right) of filtered http streams in favor of performance. This has little consequence given limited filter support in 4.3 branch. Filters will be redesigned in 5.0 release. For more information see Wez, Ilia, or myself. Index: php4/ext/standard/http_fopen_wrapper.c diff -u php4/ext/standard/http_fopen_wrapper.c:1.53.2.4 php4/ext/standard/http_fopen_wrapper.c:1.53.2.5 --- php4/ext/standard/http_fopen_wrapper.c:1.53.2.4 Fri Feb 7 20:36:52 2003 +++ php4/ext/standard/http_fopen_wrapper.c Wed Feb 12 19:42:06 2003 @@ -18,7 +18,7 @@ | Wez Furlong <[EMAIL PROTECTED]> | +----------------------------------------------------------------------+ */ -/* $Id: http_fopen_wrapper.c,v 1.53.2.4 2003/02/08 01:36:52 pollita Exp $ */ +/* $Id: http_fopen_wrapper.c,v 1.53.2.5 2003/02/13 00:42:06 pollita Exp $ */ #include "php.h" #include "php_globals.h" @@ -122,8 +122,11 @@ if (stream == NULL) goto out; - /* avoid buffering issues while reading header */ - chunk_size = php_stream_set_chunk_size(stream, 1); + /* Ordinarily we'd always reduce chunk_size to 1 to avoid filter problems. + However, since 4.3 filter support is extremely limited and will be +completely rewritten in 5.0 + we'll accept the unexpected behavior of filtered http streams in favor of +improved performance. */ + if (options & STREAM_WILL_CAST) + chunk_size = php_stream_set_chunk_size(stream, 1); php_stream_context_set(stream, context); @@ -399,8 +402,9 @@ if (stream) { stream->wrapperdata = response_header; php_stream_notify_progress_init(context, 0, file_size); - /* Restore original chunk size now that we're done with headers */ - php_stream_set_chunk_size(stream, chunk_size); + /* Restore original chunk size now that we're done with headers (if +applicable) */ + if (options & STREAM_WILL_CAST) + php_stream_set_chunk_size(stream, chunk_size); /* as far as streams are concerned, we are now at the start of * the stream */ stream->position = 0;
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php