mirror of
https://github.com/curl/curl.git
synced 2026-08-25 19:23:32 +03:00
http: make Curl_compareheader() take string length arguments too
Also add STRCONST, a macro that returns a string literal and it's length for functions that take "string,len" Removes unnecesary calls to strlen(). Closes #8391
This commit is contained in:
parent
a42677f0d8
commit
4028892f14
4 changed files with 39 additions and 17 deletions
|
|
@ -589,7 +589,8 @@ static CURLcode CONNECT(struct Curl_easy *data,
|
|||
strlen("Content-Length:"), NULL, 10, &s->cl);
|
||||
}
|
||||
}
|
||||
else if(Curl_compareheader(linep, "Connection:", "close"))
|
||||
else if(Curl_compareheader(linep,
|
||||
STRCONST("Connection:"), STRCONST("close")))
|
||||
s->close_connection = TRUE;
|
||||
else if(checkprefix("Transfer-Encoding:", linep)) {
|
||||
if(k->httpcode/100 == 2) {
|
||||
|
|
@ -600,14 +601,17 @@ static CURLcode CONNECT(struct Curl_easy *data,
|
|||
"CONNECT %03d response", k->httpcode);
|
||||
}
|
||||
else if(Curl_compareheader(linep,
|
||||
"Transfer-Encoding:", "chunked")) {
|
||||
STRCONST("Transfer-Encoding:"),
|
||||
STRCONST("chunked"))) {
|
||||
infof(data, "CONNECT responded chunked");
|
||||
s->chunked_encoding = TRUE;
|
||||
/* init our chunky engine */
|
||||
Curl_httpchunk_init(data);
|
||||
}
|
||||
}
|
||||
else if(Curl_compareheader(linep, "Proxy-Connection:", "close"))
|
||||
else if(Curl_compareheader(linep,
|
||||
STRCONST("Proxy-Connection:"),
|
||||
STRCONST("close")))
|
||||
s->close_connection = TRUE;
|
||||
else if(2 == sscanf(linep, "HTTP/1.%d %d",
|
||||
&subversion,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue