http2: return recv error on unexpected EOF

Pointed-out-by: Tatsuhiro Tsujikawa
Bug: http://curl.haxx.se/bug/view.cgi?id=1487
This commit is contained in:
Daniel Stenberg 2015-02-25 13:50:31 +01:00
parent 1514b718e3
commit bc3a44aebc
1 changed files with 5 additions and 4 deletions

View File

@ -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);