Skip to content

Commit

Permalink
http2: Fix http2_recv to return -1 if recv returned -1
Browse files Browse the repository at this point in the history
If the underlying recv called by http2_recv returns -1 then that is the
value http2_recv returns to the caller.
  • Loading branch information
jay committed Oct 9, 2015
1 parent d30ad55 commit 048f846
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions lib/http2.c
Expand Up @@ -1094,15 +1094,11 @@ static ssize_t http2_recv(struct connectdata *conn, int sockindex,
nread = ((Curl_recv *)httpc->recv_underlying)(
conn, FIRSTSOCKET, httpc->inbuf, H2_BUFSIZE, &result);

if(result == CURLE_AGAIN) {
*err = result;
return -1;
}

if(nread == -1) {
failf(data, "Failed receiving HTTP2 data");
if(result != CURLE_AGAIN)
failf(data, "Failed receiving HTTP2 data");
*err = result;
return 0;
return -1;
}

if(nread == 0) {
Expand Down

0 comments on commit 048f846

Please sign in to comment.