| From c7de3617464f935f6bab113b4da1bb91253baa7e Mon Sep 17 00:00:00 2001 |
| From: Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> |
| Date: Sat, 13 Sep 2014 11:59:23 +0900 |
| Subject: [PATCH] http2: Fix busy loop when EOF is encountered |
| Previously we did not handle EOF from underlying transport socket and |
| wrongly just returned error code CURL_AGAIN from http2_recv, which |
| caused busy loop since socket has been closed. This patch adds the |
| code to handle EOF situation and tells the upper layer that we got |
| 1 file changed, 6 insertions(+) |
| diff --git a/lib/http2.c b/lib/http2.c |
| index 604514d..f86d3eb 100644 |
| @@ -744,6 +744,12 @@ static ssize_t http2_recv(struct connectdata *conn, int sockindex, |
| infof(conn->data, "nread=%zd\n", nread); |
| + failf(conn->data, "EOF"); |
| rv = nghttp2_session_mem_recv(httpc->h2, |
| (const uint8_t *)httpc->inbuf, nread); |