1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

Stephan Bergmann pointed out two flaws in libcurl built with HTTP disabled:

1) the proxy environment variables are still read and used to set HTTP proxy

2) you couldn't disable http proxy with CURLOPT_PROXY (since the option was
   disabled)
This commit is contained in:
Daniel Stenberg 2005-01-19 09:36:44 +00:00
parent 0406b1facf
commit a0c8b9bc68
2 changed files with 34 additions and 22 deletions

10
CHANGES
View File

@ -7,6 +7,16 @@
Changelog
Daniel (19 January 2005)
- Stephan Bergmann pointed out two flaws in libcurl built with HTTP disabled:
1) the proxy environment variables are still read and used to set HTTP proxy
2) you couldn't disable http proxy with CURLOPT_PROXY (since the option was
disabled)
Based on Stephan's patch, both these issues should now be fixed.
Daniel (18 January 2005)
- Cody Jones' enhanced version of Samuel Díaz García's MSVC makefile patch was
applied.

View File

@ -779,7 +779,7 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, ...)
*/
data->set.cookiesession = (bool)va_arg(param, long);
break;
#endif
#endif /* CURL_DISABLE_COOKIES */
case CURLOPT_HTTPGET:
/*
@ -818,27 +818,6 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, ...)
and this just changes the actual request keyword */
break;
case CURLOPT_PROXY:
/*
* Set proxy server:port to use as HTTP proxy.
*
* If the proxy is set to "" we explicitly say that we don't want to use a
* proxy (even though there might be environment variables saying so).
*
* Setting it to NULL, means no proxy but allows the environment variables
* to decide for us.
*/
if(data->change.proxy_alloc) {
/*
* The already set string is allocated, free that first
*/
data->change.proxy_alloc=FALSE;;
free(data->change.proxy);
}
data->set.set_proxy = va_arg(param, char *);
data->change.proxy = data->set.set_proxy;
break;
case CURLOPT_PROXYPORT:
/*
* Explicitly set HTTP proxy port number.
@ -887,6 +866,27 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, ...)
break;
#endif /* CURL_DISABLE_HTTP */
case CURLOPT_PROXY:
/*
* Set proxy server:port to use as HTTP proxy.
*
* If the proxy is set to "" we explicitly say that we don't want to use a
* proxy (even though there might be environment variables saying so).
*
* Setting it to NULL, means no proxy but allows the environment variables
* to decide for us.
*/
if(data->change.proxy_alloc) {
/*
* The already set string is allocated, free that first
*/
data->change.proxy_alloc=FALSE;;
free(data->change.proxy);
}
data->set.set_proxy = va_arg(param, char *);
data->change.proxy = data->set.set_proxy;
break;
case CURLOPT_WRITEHEADER:
/*
* Custom pointer to pass the header write callback function
@ -2439,6 +2439,7 @@ static CURLcode CreateConnection(struct SessionHandle *data,
return CURLE_OUT_OF_MEMORY;
}
#ifndef CURL_DISABLE_HTTP
/*************************************************************
* Detect what (if any) proxy to use
*************************************************************/
@ -2603,6 +2604,7 @@ static CURLcode CreateConnection(struct SessionHandle *data,
if(no_proxy)
free(no_proxy);
} /* if not using proxy */
#endif /* CURL_DISABLE_HTTP */
/*************************************************************
* No protocol part in URL was used, add it!