aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2016-04-11 16:00:15 +0200
committerDaniel Stenberg <daniel@haxx.se>2016-04-11 16:01:58 +0200
commitb2a0376350cb4f788ca2cdff2e89a23bdc789888 (patch)
tree51c1c534c7efb40b65518f7f5d7f4293a31f11e9 /lib
parent15cadb1f7aede9c5ee111a0f589820d83ee07ba2 (diff)
http2: drain the socket better...
... 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
Diffstat (limited to 'lib')
-rw-r--r--lib/http2.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/http2.c b/lib/http2.c
index 5305eb71e..8f19ebaee 100644
--- a/lib/http2.c
+++ b/lib/http2.c
@@ -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;
}