diff options
author | Jay Satiro <raysatiro@yahoo.com> | 2015-10-08 02:48:44 -0400 |
---|---|---|
committer | Jay Satiro <raysatiro@yahoo.com> | 2015-10-09 00:29:25 -0400 |
commit | 048f84637f9d2dcdbf889a7a0a1e2780aac687b7 (patch) | |
tree | 6bad54e2a368df499cad381e5d43405298dc18ee | |
parent | d30ad55c5955ed215773b79cd46c97d48795b7a6 (diff) |
http2: Fix http2_recv to return -1 if recv returned -1
If the underlying recv called by http2_recv returns -1 then that is the
value http2_recv returns to the caller.
-rw-r--r-- | lib/http2.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/http2.c b/lib/http2.c index de6d03d39..bd29a926b 100644 --- a/lib/http2.c +++ b/lib/http2.c @@ -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) { |