mirror of
https://github.com/curl/curl.git
synced 2026-08-26 17:53:33 +03:00
lib: make protocol handlers store scheme name lowercase
- saves a lowercase operation when the "[scheme]_proxy" name is generated - appears less "shouting" - update test 970, 972, 1438 and 1536 Closes #13553
This commit is contained in:
parent
848c104639
commit
c294f9cb56
23 changed files with 43 additions and 47 deletions
11
lib/url.c
11
lib/url.c
|
|
@ -2083,19 +2083,13 @@ static char *detect_proxy(struct Curl_easy *data,
|
|||
* For compatibility, the all-uppercase versions of these variables are
|
||||
* checked if the lowercase versions don't exist.
|
||||
*/
|
||||
char proxy_env[128];
|
||||
const char *protop = conn->handler->scheme;
|
||||
char proxy_env[20];
|
||||
char *envp = proxy_env;
|
||||
#ifdef CURL_DISABLE_VERBOSE_STRINGS
|
||||
(void)data;
|
||||
#endif
|
||||
|
||||
/* Now, build <protocol>_proxy and check for such a one to use */
|
||||
while(*protop)
|
||||
*envp++ = Curl_raw_tolower(*protop++);
|
||||
|
||||
/* append _proxy */
|
||||
strcpy(envp, "_proxy");
|
||||
msnprintf(proxy_env, sizeof(proxy_env), "%s_proxy", conn->handler->scheme);
|
||||
|
||||
/* read the protocol proxy: */
|
||||
proxy = curl_getenv(proxy_env);
|
||||
|
|
@ -2118,7 +2112,6 @@ static char *detect_proxy(struct Curl_easy *data,
|
|||
proxy = curl_getenv(proxy_env);
|
||||
}
|
||||
|
||||
envp = proxy_env;
|
||||
if(!proxy) {
|
||||
#ifdef USE_WEBSOCKETS
|
||||
/* websocket proxy fallbacks */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue