summaryrefslogtreecommitdiff
path: root/lib/http2.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2021-05-17 09:05:39 +0200
committerDaniel Stenberg <daniel@haxx.se>2021-05-17 14:44:13 +0200
commit904b27d18da1f7310f38b5117a0916d8b96d130c (patch)
treee4a0d92ab07e8ee824c0e788234f563aefc53fec /lib/http2.c
parent5dfa4c08bbef38f9e533439d11f27096bb09d41c (diff)
downloadcurl-904b27d18da1f7310f38b5117a0916d8b96d130c.tar.gz
http2: make sure pause is done on HTTP
Since the function is called for any protocol, we can't assume that the HTTP struct is there without first making sure it is HTTP. Reported-by: Denis Goleshchikhin Fixes #7079 Closes #7080
Diffstat (limited to 'lib/http2.c')
-rw-r--r--lib/http2.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/http2.c b/lib/http2.c
index ac04d348c..bc604ce15 100644
--- a/lib/http2.c
+++ b/lib/http2.c
@@ -2353,7 +2353,8 @@ CURLcode Curl_http2_stream_pause(struct Curl_easy *data, bool pause)
DEBUGASSERT(data);
DEBUGASSERT(data->conn);
/* if it isn't HTTP/2, we're done */
- if(!data->conn->proto.httpc.h2)
+ if(!(data->conn->handler->protocol & PROTO_FAMILY_HTTP) ||
+ !data->conn->proto.httpc.h2)
return CURLE_OK;
#ifdef NGHTTP2_HAS_SET_LOCAL_WINDOW_SIZE
else {