From: Michael Wallner Date: Wed, 2 Sep 2009 12:07:00 +0000 (+0000) Subject: Fixed pecl bug #16817 (Proxy-Auth. and WWW-Auth. credentials mixed after connection... X-Git-Tag: RELEASE_1_7_0b2~15 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=04491f8ea81849ecb509b96c480ffe6f00d0cfd4;p=m6w6%2Fext-http Fixed pecl bug #16817 (Proxy-Auth. and WWW-Auth. credentials mixed after connection reuse) --- diff --git a/http_request_api.c b/http_request_api.c index 817fa3a..1d1252a 100644 --- a/http_request_api.c +++ b/http_request_api.c @@ -477,7 +477,9 @@ PHP_HTTP_API void _http_request_defaults(http_request *request) HTTP_CURL_OPT(CURLOPT_PROXY, NULL); HTTP_CURL_OPT(CURLOPT_PROXYPORT, 0L); HTTP_CURL_OPT(CURLOPT_PROXYTYPE, 0L); - HTTP_CURL_OPT(CURLOPT_PROXYUSERPWD, NULL); + /* libcurl < 7.19.6 does not clear auth info with USERPWD set to NULL */ + HTTP_CURL_OPT(CURLOPT_PROXYUSERNAME, NULL); + HTTP_CURL_OPT(CURLOPT_PROXYPASSWORD, NULL); HTTP_CURL_OPT(CURLOPT_PROXYAUTH, 0L); HTTP_CURL_OPT(CURLOPT_HTTPPROXYTUNNEL, 0L); HTTP_CURL_OPT(CURLOPT_DNS_CACHE_TIMEOUT, 60L); @@ -496,11 +498,16 @@ PHP_HTTP_API void _http_request_defaults(http_request *request) HTTP_CURL_OPT(CURLOPT_FORBID_REUSE, 0L); HTTP_CURL_OPT(CURLOPT_INTERFACE, NULL); HTTP_CURL_OPT(CURLOPT_PORT, 0L); +#if HTTP_CURL_VERSION(7,19,0) + HTTP_CURL_OPT(CURLOPT_ADDRESS_SCOPE, 0L); +#endif #if HTTP_CURL_VERSION(7,15,2) HTTP_CURL_OPT(CURLOPT_LOCALPORT, 0L); HTTP_CURL_OPT(CURLOPT_LOCALPORTRANGE, 0L); #endif - HTTP_CURL_OPT(CURLOPT_USERPWD, NULL); + /* libcurl < 7.19.6 does not clear auth info with USERPWD set to NULL */ + HTTP_CURL_OPT(CURLOPT_USERNAME, NULL); + HTTP_CURL_OPT(CURLOPT_PASSWORD, NULL); HTTP_CURL_OPT(CURLOPT_HTTPAUTH, 0L); HTTP_CURL_OPT(CURLOPT_ENCODING, NULL); #if HTTP_CURL_VERSION(7,16,2) @@ -519,6 +526,9 @@ PHP_HTTP_API void _http_request_defaults(http_request *request) HTTP_CURL_OPT(CURLOPT_USERAGENT, "PECL::HTTP/" PHP_HTTP_VERSION " (PHP/" PHP_VERSION ")"); HTTP_CURL_OPT(CURLOPT_HTTPHEADER, NULL); HTTP_CURL_OPT(CURLOPT_COOKIE, NULL); + HTTP_CURL_OPT(CURLOPT_COOKIESESSION, 0L); + HTTP_CURL_OPT(CURLOPT_COOKIEFILE, NULL); + HTTP_CURL_OPT(CURLOPT_COOKIEJAR, NULL); #if HTTP_CURL_VERSION(7,14,1) HTTP_CURL_OPT(CURLOPT_COOKIELIST, NULL); #endif