mike Tue Jun 6 21:38:29 2006 UTC
Modified files:
/php-src/ext/curl streams.c
Log:
MFB: only try to fetch stream context options if context is set
http://cvs.php.net/viewcvs.cgi/php-src/ext/curl/streams.c?r1=1.17&r2=1.18&diff_format=u
Index: php-src/ext/curl/streams.c
diff -u php-src/ext/curl/streams.c:1.17 php-src/ext/curl/streams.c:1.18
--- php-src/ext/curl/streams.c:1.17 Thu May 25 12:47:46 2006
+++ php-src/ext/curl/streams.c Tue Jun 6 21:38:28 2006
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: streams.c,v 1.17 2006/05/25 12:47:46 mike Exp $ */
+/* $Id: streams.c,v 1.18 2006/06/06 21:38:28 mike Exp $ */
/* This file implements cURL based wrappers.
* NOTE: If you are implementing your own streams that are intended to
@@ -300,7 +300,7 @@
curl_easy_setopt(curlstream->curl, CURLOPT_USERAGENT, FG(user_agent) ?
FG(user_agent) : "PHP/" PHP_VERSION);
/* TODO: read cookies and options from context */
- if (!strncasecmp(filename, "http", sizeof("http")-1)) {
+ if (context && !strncasecmp(filename, "http", sizeof("http")-1)) {
/* HTTP(S) */
if (SUCCESS == php_stream_context_get_option(context, "http",
"user_agent", &ctx_opt) && Z_TYPE_PP(ctx_opt) == IS_STRING) {
curl_easy_setopt(curlstream->curl, CURLOPT_USERAGENT,
Z_STRVAL_PP(ctx_opt));
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php