Skip to content

Commit

Permalink
http: separate response parsing from response action
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
icing authored and bagder committed Mar 21, 2024
1 parent 0c82042 commit 0f08b43
Show file tree
Hide file tree
Showing 3 changed files with 339 additions and 317 deletions.
7 changes: 3 additions & 4 deletions lib/c-hyper.c
Expand Up @@ -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;

Expand Down

0 comments on commit 0f08b43

Please sign in to comment.