summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeng-Yu Chen <pengyu@libstarrify.so>2021-05-10 23:50:27 +0100
committerDaniel Stenberg <daniel@haxx.se>2021-05-11 07:58:14 +0200
commit651a75e1e71be0eeb27cbfa041225a725debef9e (patch)
tree42b53481b6983f77f5babc224c1aeeac1e3781f5
parent1e19eceb50d6d8b9c9b37e2f8e1259b2f311c82a (diff)
downloadcurl-651a75e1e71be0eeb27cbfa041225a725debef9e.tar.gz
http2: use nghttp2_session_upgrade2 instead of nghttp2_session_upgrade
Following the upstream deprecation of nghttp2_session_upgrade. Also provides further checks for requests with the HEAD method. Closes #7041
-rw-r--r--lib/http2.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/http2.c b/lib/http2.c
index 03c101e35..661a4cbab 100644
--- a/lib/http2.c
+++ b/lib/http2.c
@@ -2273,10 +2273,10 @@ CURLcode Curl_http2_switched(struct Curl_easy *data,
/* stream 1 is opened implicitly on upgrade */
stream->stream_id = 1;
/* queue SETTINGS frame (again) */
- rv = nghttp2_session_upgrade(httpc->h2, httpc->binsettings,
- httpc->binlen, NULL);
+ rv = nghttp2_session_upgrade2(httpc->h2, httpc->binsettings, httpc->binlen,
+ data->state.httpreq == HTTPREQ_HEAD, NULL);
if(rv) {
- failf(data, "nghttp2_session_upgrade() failed: %s(%d)",
+ failf(data, "nghttp2_session_upgrade2() failed: %s(%d)",
nghttp2_strerror(rv), rv);
return CURLE_HTTP2;
}