diff options
author | Daniel Stenberg <daniel@haxx.se> | 2005-01-19 09:36:44 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2005-01-19 09:36:44 +0000 |
commit | a0c8b9bc68730bf6290a308602d3f793a6bde25f (patch) | |
tree | d4c62b83b3269b790fa6b511641bc2ed7256c3f5 | |
parent | 0406b1facf8fa0190806d76bddc0578793f01c39 (diff) |
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)
-rw-r--r-- | CHANGES | 10 | ||||
-rw-r--r-- | lib/url.c | 46 |
2 files changed, 34 insertions, 22 deletions
@@ -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. @@ -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! |