]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
http2: make sure pause is done on HTTP
authorDaniel Stenberg <daniel@haxx.se>
Mon, 17 May 2021 07:05:39 +0000 (09:05 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 17 May 2021 12:44:13 +0000 (14:44 +0200)
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

lib/http2.c

index ac04d348c4957040f696e1ffd6b2b7e40a661ddb..bc604ce1551a50dfdf5c36962db634e36a1af470 100644 (file)
@@ -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 {