]> granicus.if.org Git - curl/commitdiff
http2: when marked for closure and wanted to close == OK
authorDaniel Stenberg <daniel@haxx.se>
Mon, 26 Aug 2019 14:00:05 +0000 (16:00 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 26 Aug 2019 20:44:59 +0000 (22:44 +0200)
It could otherwise return an error even when closed correctly if GOAWAY
had been received previously.

Reported-by: Tom van der Woerdt
Fixes #4267
Closes #4268

lib/http2.c

index 930e8516530dabaaaee97332d40c32614a6b37da..31d2d698ade7eff84d27c8d22b17c061934484a0 100644 (file)
@@ -1559,6 +1559,11 @@ static ssize_t http2_recv(struct connectdata *conn, int sockindex,
   if(should_close_session(httpc)) {
     H2BUGF(infof(data,
                  "http2_recv: nothing to do in this session\n"));
+    if(conn->bits.close) {
+      /* already marked for closure, return OK and we're done */
+      *err = CURLE_OK;
+      return 0;
+    }
     *err = CURLE_HTTP2;
     return -1;
   }