aboutsummaryrefslogtreecommitdiff
path: root/lib/http2.c
diff options
context:
space:
mode:
authorJay Satiro <raysatiro@yahoo.com>2015-10-08 02:48:44 -0400
committerJay Satiro <raysatiro@yahoo.com>2015-10-09 00:29:25 -0400
commit048f84637f9d2dcdbf889a7a0a1e2780aac687b7 (patch)
tree6bad54e2a368df499cad381e5d43405298dc18ee /lib/http2.c
parentd30ad55c5955ed215773b79cd46c97d48795b7a6 (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.
Diffstat (limited to 'lib/http2.c')
-rw-r--r--lib/http2.c10
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) {