aboutsummaryrefslogtreecommitdiff
path: root/lib/http.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2019-08-05 15:17:31 +0200
committerDaniel Stenberg <daniel@haxx.se>2019-08-06 07:39:21 +0200
commitdc35631ef7fe314c227ba0b8529a4e0f5f383f79 (patch)
tree828a024aba273587cbecad74ccfe0fbc6b39e8dc /lib/http.c
parenta42b0957ab31c971a79bfe5542b3017fd834ac49 (diff)
quiche: first working HTTP/3 request
- enable debug log - fix use of quiche API - use download buffer - separate header/body Closes #4193
Diffstat (limited to 'lib/http.c')
-rw-r--r--lib/http.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/http.c b/lib/http.c
index 83180fb29..9d8cd5570 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -3677,6 +3677,7 @@ CURLcode Curl_http_readwrite_headers(struct Curl_easy *data,
* guarantees on future behaviors since it isn't within the protocol.
*/
char separator;
+ char twoorthree[2];
nc = sscanf(HEADER1,
" HTTP/%1d.%1d%c%3d",
&httpversion_major,
@@ -3684,8 +3685,8 @@ CURLcode Curl_http_readwrite_headers(struct Curl_easy *data,
&separator,
&k->httpcode);
- if(nc == 1 && httpversion_major == 2 &&
- 1 == sscanf(HEADER1, " HTTP/2 %d", &k->httpcode)) {
+ if(nc == 1 && httpversion_major >= 2 &&
+ 2 == sscanf(HEADER1, " HTTP/%1[23] %d", twoorthree, &k->httpcode)) {
conn->httpversion = 0;
nc = 4;
separator = ' ';
@@ -3723,7 +3724,7 @@ CURLcode Curl_http_readwrite_headers(struct Curl_easy *data,
}
}
else {
- failf(data, "Unsupported HTTP version in response\n");
+ failf(data, "Unsupported HTTP version in response");
return CURLE_UNSUPPORTED_PROTOCOL;
}
}