From: Daniel Stenberg Date: Wed, 25 Feb 2015 12:50:31 +0000 (+0100) Subject: http2: return recv error on unexpected EOF X-Git-Tag: curl-7_42_0~219 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bc3a44aebc22f5427e8408894982af6c1e8d7b1b;p=thirdparty%2Fcurl.git http2: return recv error on unexpected EOF Pointed-out-by: Tatsuhiro Tsujikawa Bug: http://curl.haxx.se/bug/view.cgi?id=1487 --- diff --git a/lib/http2.c b/lib/http2.c index 6712460589..8cde9101ce 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);