]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
h2: do not wait for RECV on paused transfers
authorDaniel Stenberg <daniel@haxx.se>
Tue, 22 Dec 2020 08:09:46 +0000 (09:09 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 22 Dec 2020 11:44:18 +0000 (12:44 +0100)
... as the socket might be readable all the time when paused and thus
causing a busy-loop.

Reported-by: Harry Sintonen
Reviewed-by: Jay Satiro
Fixes #6356
Closes #6357

lib/http2.c

index b138fb4b0f6dbf8bfd870752dc1de70c3cae6473..7a337a7f3e2982ef2ed4f1445ea8e3609b16fcd6 100644 (file)
@@ -101,9 +101,10 @@ static int http2_perform_getsock(const struct connectdata *conn,
 
   sock[0] = conn->sock[FIRSTSOCKET];
 
-  /* in a HTTP/2 connection we can basically always get a frame so we should
-     always be ready for one */
-  bitmap |= GETSOCK_READSOCK(FIRSTSOCKET);
+  if(!(k->keepon & KEEP_RECV_PAUSE))
+    /* Unless paused - in a HTTP/2 connection we can basically always get a
+       frame so we should always be ready for one */
+    bitmap |= GETSOCK_READSOCK(FIRSTSOCKET);
 
   /* we're still uploading or the HTTP/2 layer wants to send data */
   if(((k->keepon & (KEEP_SEND|KEEP_SEND_PAUSE)) == KEEP_SEND) ||