Re: cvs: php-src(PHP_5_1) / NEWS /ext/standard url.c

From: Date: Thu, 19 Jan 2006 15:50:33 +0000
Subject: Re: cvs: php-src(PHP_5_1) / NEWS /ext/standard url.c
References: 1  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-36576@lists.php.net to get a copy of this message
iliaa Wed Jan 18 14:05:14 2006 UTC
 Modified files:              (Branch: PHP_5_1)
/php-src/ext/standard url.c /php-src NEWS Log: Make get_headers() use the default context. http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/url.c?r1=1.86.2.3&r2=1.86.2.4&diff_format=u Index: php-src/ext/standard/url.c diff -u php-src/ext/standard/url.c:1.86.2.3 php-src/ext/standard/url.c:1.86.2.4 --- php-src/ext/standard/url.c:1.86.2.3 Sun Jan 1 12:50:15 2006 +++ php-src/ext/standard/url.c Wed Jan 18 14:05:14 2006 @@ -15,7 +15,7 @@ | Author: Jim Winstead <jimw@php.net> | +----------------------------------------------------------------------+ */ -/* $Id: url.c,v 1.86.2.3 2006/01/01 12:50:15 sniper Exp $ */ +/* $Id: url.c,v 1.86.2.4 2006/01/18 14:05:14 iliaa Exp $ */ #include <stdlib.h> #include <string.h> @@ -25,6 +25,7 @@ #include "php.h" #include "url.h" +#include "file.h" #ifdef _OSD_POSIX #ifndef APACHE #error On this EBCDIC platform, PHP is only supported as an Apache module. @@ -658,7 +659,7 @@ { char *url; int url_len; - php_stream_context *context = NULL; + php_stream_context *context; php_stream *stream; zval **prev_val, **hdr = NULL; HashPosition pos; @@ -667,6 +668,7 @@ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &url, &url_len, &format) == FAILURE) { return; } + context = FG(default_context) ? FG(default_context) : (FG(default_context) = php_stream_context_alloc());
Just a little thought: why do you need to allocate a new context, instead of passing NULL? I think FG(default_context) can be passed safely as the context argument, thus saving memory if the default options aren't changed. Nuno

« previous php.cvs (#36576) next »