]> granicus.if.org Git - curl/commitdiff
http2: drain the socket better...
authorDaniel Stenberg <daniel@haxx.se>
Mon, 11 Apr 2016 14:00:15 +0000 (16:00 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 11 Apr 2016 14:01:58 +0000 (16:01 +0200)
... but ignore EAGAIN if the stream has ended so that we don't end up in
a loop. This is a follow-up to c8ab613 in order to avoid the problem
d261652 was made to fix.

Reported-by: Jay Satiro
Clues-provided-by: Tatsuhiro Tsujikawa
Discussed in #750

lib/http2.c

index 5305eb71e11aee7500565e2306646ff8077a88b5..8f19ebaeec75ea2a795a5257c1baee768c02c28b 100644 (file)
@@ -1246,6 +1246,10 @@ static ssize_t http2_recv(struct connectdata *conn, int sockindex,
       if(nread == -1) {
         if(result != CURLE_AGAIN)
           failf(data, "Failed receiving HTTP2 data");
+        else if(stream->closed)
+          /* received when the stream was already closed! */
+          return http2_handle_stream_close(conn, data, stream, err);
+
         *err = result;
         return -1;
       }