aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2015-02-25 13:50:31 +0100
committerDaniel Stenberg <daniel@haxx.se>2015-02-25 13:51:21 +0100
commitbc3a44aebc22f5427e8408894982af6c1e8d7b1b (patch)
tree14c8241148381993f27bef49f730ff1428104f43
parent1514b718e3e5ea08acd1816464809de49a211f38 (diff)
http2: return recv error on unexpected EOF
Pointed-out-by: Tatsuhiro Tsujikawa Bug: http://curl.haxx.se/bug/view.cgi?id=1487
-rw-r--r--lib/http2.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/http2.c b/lib/http2.c
index 671246058..8cde9101c 100644
--- a/lib/http2.c
+++ b/lib/http2.c
@@ -749,13 +749,14 @@ static ssize_t http2_recv(struct connectdata *conn, int sockindex,
return 0;
}
- DEBUGF(infof(conn->data, "nread=%zd\n", nread));
-
if(nread == 0) {
- failf(conn->data, "EOF");
- return 0;
+ failf(conn->data, "Unexpected EOF");
+ *err = CURLE_RECV_ERROR;
+ return -1;
}
+ DEBUGF(infof(conn->data, "nread=%zd\n", nread));
+
rv = nghttp2_session_mem_recv(httpc->h2,
(const uint8_t *)httpc->inbuf, nread);