From 048f84637f9d2dcdbf889a7a0a1e2780aac687b7 Mon Sep 17 00:00:00 2001 From: Jay Satiro Date: Thu, 8 Oct 2015 02:48:44 -0400 Subject: [PATCH] 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. --- lib/http2.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/http2.c b/lib/http2.c index de6d03d39de497..bd29a926b142af 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) {