cvs: php-src / NEWS /ext/standard http_fopen_wrapper.c
| From: | Ilia Alshanetsky | Date: | Fri, 06 May 2005 02:31:08 +0000 |
| Subject: | cvs: php-src / NEWS /ext/standard http_fopen_wrapper.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-31746@lists.php.net to get a copy of this message | ||
iliaa Thu May 5 22:31:08 2005 EDT
Modified files:
/php-src NEWS
/php-src/ext/standard http_fopen_wrapper.c
Log:
Added max_redirects context option that specifies how many HTTP redirects
to follow.
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1892&r2=1.1893&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1892 php-src/NEWS:1.1893
--- php-src/NEWS:1.1892 Thu May 5 20:29:30 2005
+++ php-src/NEWS Thu May 5 22:31:05 2005
@@ -101,6 +101,8 @@
- Added zlib stream filter support. (Sara)
- Added bz2 stream filter support. (Sara)
- Added HTTP/1.1 and chunked encoding support to http:// wrapper. (Sara)
+- Added max_redirects context option that specifies how many HTTP
+ redirects to follow. (Ilia)
- Added support of parameter=>value arrays to
xsl_xsltprocessor_set_parameter(). (Tony)
- Fixed extension initialization to respect dependancies between extensions.
http://cvs.php.net/diff.php/php-src/ext/standard/http_fopen_wrapper.c?r1=1.95&r2=1.96&ty=u
Index: php-src/ext/standard/http_fopen_wrapper.c
diff -u php-src/ext/standard/http_fopen_wrapper.c:1.95
php-src/ext/standard/http_fopen_wrapper.c:1.96
--- php-src/ext/standard/http_fopen_wrapper.c:1.95 Thu May 5 22:20:00 2005
+++ php-src/ext/standard/http_fopen_wrapper.c Thu May 5 22:31:07 2005
@@ -19,7 +19,7 @@
| Sara Golemon <pollita@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: http_fopen_wrapper.c,v 1.95 2005/05/06 02:20:00 iliaa Exp $ */
+/* $Id: http_fopen_wrapper.c,v 1.96 2005/05/06 02:31:07 iliaa Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -104,7 +104,7 @@
int protocol_version_len = 3; /* Default: "1.0" */
if (redirect_max < 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Circular redirect, aborting.");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Redirection limit reached, aborting.");
return NULL;
}
@@ -182,6 +182,12 @@
php_stream_notify_info(context, PHP_STREAM_NOTIFY_CONNECT, NULL, 0);
+ if (header_init && context && php_stream_context_get_option(context,
"http", "max_redirects", &tmpzval) == SUCCESS) {
+ SEPARATE_ZVAL(tmpzval);
+ convert_to_long_ex(tmpzval);
+ redirect_max = Z_LVAL_PP(tmpzval);
+ }
+
if (context &&
php_stream_context_get_option(context, "http", "method", &tmpzval) ==
SUCCESS) {
if (Z_TYPE_PP(tmpzval) == IS_STRING && Z_STRLEN_PP(tmpzval) > 0) {