cvs: php4 /ext/standard http_fopen_wrapper.c
| From: | Wez Furlong | Date: | Tue, 30 Apr 2002 00:30:05 +0000 |
| Subject: | cvs: php4 /ext/standard http_fopen_wrapper.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-11548@lists.php.net to get a copy of this message | ||
wez Mon Apr 29 20:30:05 2002 EDT
Modified files:
/php4/ext/standard http_fopen_wrapper.c
Log:
Make use of new flag so that we can buffer http headers when we know that
the stream is not intended to be used in require/include.
Index: php4/ext/standard/http_fopen_wrapper.c
diff -u php4/ext/standard/http_fopen_wrapper.c:1.33 php4/ext/standard/http_fopen_wrapper.c:1.34
--- php4/ext/standard/http_fopen_wrapper.c:1.33 Fri Apr 19 03:56:40 2002
+++ php4/ext/standard/http_fopen_wrapper.c Mon Apr 29 20:30:00 2002
@@ -18,7 +18,7 @@
| Wez Furlong <wez@thebrainroom.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: http_fopen_wrapper.c,v 1.33 2002/04/19 07:56:40 yohgaki Exp $ */
+/* $Id: http_fopen_wrapper.c,v 1.34 2002/04/30 00:30:00 wez Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -104,7 +104,8 @@
goto out;
/* avoid buffering issues while reading header */
- chunk_size = php_stream_sock_set_chunk_size(stream, 1 TSRMLS_CC);
+ if (options & STREAM_WILL_CAST)
+ chunk_size = php_stream_sock_set_chunk_size(stream, 1 TSRMLS_CC);
php_stream_context_set(stream, context);
@@ -199,10 +200,12 @@
} else {
switch(response_code) {
case 403:
- php_stream_notify_error(context, PHP_STREAM_NOTIFY_AUTH_RESULT, tmp_line, response_code);
+ php_stream_notify_error(context, PHP_STREAM_NOTIFY_AUTH_RESULT,
+ tmp_line, response_code);
break;
default:
- php_stream_notify_error(context, PHP_STREAM_NOTIFY_FAILURE, tmp_line, response_code);
+ php_stream_notify_error(context, PHP_STREAM_NOTIFY_FAILURE,
+ tmp_line, response_code);
}
}
@@ -332,7 +335,8 @@
if (stream) {
stream->wrapperdata = response_header;
php_stream_notify_progress_init(context, 0, file_size);
- php_stream_sock_set_chunk_size(stream, chunk_size TSRMLS_CC);
+ if (options & STREAM_WILL_CAST)
+ php_stream_sock_set_chunk_size(stream, chunk_size TSRMLS_CC);
}
if (response_header) {
@@ -342,7 +346,6 @@
zval_copy_ctor(sym);
ZEND_SET_SYMBOL(EG(active_symbol_table), "http_response_header", sym);
}
-
return stream;
}