mirror of
https://github.com/curl/curl.git
synced 2026-07-23 11:17:16 +03:00
misc: remove strlen for Curl_checkheaders + Curl_checkProxyheaders
Closes #8409
This commit is contained in:
parent
3738de3bd1
commit
9bc3cebc92
11 changed files with 80 additions and 63 deletions
|
|
@ -244,7 +244,7 @@ static CURLcode CONNECT_host(struct Curl_easy *data,
|
|||
if(!hostheader)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
||||
if(!Curl_checkProxyheaders(data, conn, "Host")) {
|
||||
if(!Curl_checkProxyheaders(data, conn, STRCONST("Host"))) {
|
||||
host = aprintf("Host: %s\r\n", hostheader);
|
||||
if(!host) {
|
||||
free(hostheader);
|
||||
|
|
@ -323,12 +323,14 @@ static CURLcode CONNECT(struct Curl_easy *data,
|
|||
data->state.aptr.proxyuserpwd?
|
||||
data->state.aptr.proxyuserpwd:"");
|
||||
|
||||
if(!result && !Curl_checkProxyheaders(data, conn, "User-Agent") &&
|
||||
if(!result && !Curl_checkProxyheaders(data,
|
||||
conn, STRCONST("User-Agent")) &&
|
||||
data->set.str[STRING_USERAGENT])
|
||||
result = Curl_dyn_addf(req, "User-Agent: %s\r\n",
|
||||
data->set.str[STRING_USERAGENT]);
|
||||
|
||||
if(!result && !Curl_checkProxyheaders(data, conn, "Proxy-Connection"))
|
||||
if(!result && !Curl_checkProxyheaders(data, conn,
|
||||
STRCONST("Proxy-Connection")))
|
||||
result = Curl_dyn_addn(req,
|
||||
STRCONST("Proxy-Connection: Keep-Alive\r\n"));
|
||||
|
||||
|
|
@ -875,7 +877,7 @@ static CURLcode CONNECT(struct Curl_easy *data,
|
|||
goto error;
|
||||
}
|
||||
|
||||
if(!Curl_checkProxyheaders(data, conn, "User-Agent") &&
|
||||
if(!Curl_checkProxyheaders(data, conn, STRCONST("User-Agent")) &&
|
||||
data->set.str[STRING_USERAGENT]) {
|
||||
struct dynbuf ua;
|
||||
Curl_dyn_init(&ua, DYN_HTTP_REQUEST);
|
||||
|
|
@ -889,7 +891,7 @@ static CURLcode CONNECT(struct Curl_easy *data,
|
|||
Curl_dyn_free(&ua);
|
||||
}
|
||||
|
||||
if(!Curl_checkProxyheaders(data, conn, "Proxy-Connection")) {
|
||||
if(!Curl_checkProxyheaders(data, conn, STRCONST("Proxy-Connection"))) {
|
||||
result = Curl_hyper_header(data, headers,
|
||||
"Proxy-Connection: Keep-Alive");
|
||||
if(result)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue