misc: reduce strlen() calls with Curl_dyn_add()

Use STRCONST() to switch from Curl_dyn_add() to Curl_dyn_addn() for
string literals.

Closes #8398
This commit is contained in:
HenrikHolst 2022-02-07 19:25:09 +01:00 committed by Daniel Stenberg
parent 2a1951519e
commit b807219292
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
7 changed files with 37 additions and 34 deletions

View file

@ -329,14 +329,15 @@ static CURLcode CONNECT(struct Curl_easy *data,
data->set.str[STRING_USERAGENT]);
if(!result && !Curl_checkProxyheaders(data, conn, "Proxy-Connection"))
result = Curl_dyn_add(req, "Proxy-Connection: Keep-Alive\r\n");
result = Curl_dyn_addn(req,
STRCONST("Proxy-Connection: Keep-Alive\r\n"));
if(!result)
result = Curl_add_custom_headers(data, TRUE, req);
if(!result)
/* CRLF terminate the request */
result = Curl_dyn_add(req, "\r\n");
result = Curl_dyn_addn(req, STRCONST("\r\n"));
if(!result) {
/* Send the connect request to the proxy */