Skip to content

Commit

Permalink
http2: return recv error on unexpected EOF
Browse files Browse the repository at this point in the history
Pointed-out-by: Tatsuhiro Tsujikawa
Bug: http://curl.haxx.se/bug/view.cgi?id=1487
  • Loading branch information
bagder committed Feb 25, 2015
1 parent 1514b71 commit bc3a44a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/http2.c
Expand Up @@ -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);

Expand Down

0 comments on commit bc3a44a

Please sign in to comment.