mirror of
https://github.com/curl/curl.git
synced 2026-07-28 11:53:05 +03:00
http: separate response parsing from response action
- move code that triggers on end-of-response into separate function from parsing - simplify some headp/headerlen usage - add `httpversion` to SingleRequest to indicate the version of the current response Closes #13134
This commit is contained in:
parent
0c820427f2
commit
0f08b43557
3 changed files with 340 additions and 318 deletions
|
|
@ -274,14 +274,13 @@ static CURLcode status_line(struct Curl_easy *data,
|
|||
/* We need to set 'httpcodeq' for functions that check the response code in
|
||||
a single place. */
|
||||
data->req.httpcode = http_status;
|
||||
|
||||
data->req.httpversion = http_version == HYPER_HTTP_VERSION_1_1? 11 :
|
||||
(http_version == HYPER_HTTP_VERSION_2 ? 20 : 10);
|
||||
if(data->state.hconnect)
|
||||
/* CONNECT */
|
||||
data->info.httpproxycode = http_status;
|
||||
else {
|
||||
conn->httpversion =
|
||||
http_version == HYPER_HTTP_VERSION_1_1 ? 11 :
|
||||
(http_version == HYPER_HTTP_VERSION_2 ? 20 : 10);
|
||||
conn->httpversion = (unsigned char)data->req.httpversion;
|
||||
if(http_version == HYPER_HTTP_VERSION_1_0)
|
||||
data->state.httpwant = CURL_HTTP_VERSION_1_0;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue