1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-22 08:08:50 -05:00

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.
This commit is contained in:
Jay Satiro 2015-10-08 02:48:44 -04:00
parent d30ad55c59
commit 048f84637f

View File

@ -1094,17 +1094,13 @@ 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) {
if(nread == -1) {
if(result != CURLE_AGAIN)
failf(data, "Failed receiving HTTP2 data");
*err = result;
return -1;
}
if(nread == -1) {
failf(data, "Failed receiving HTTP2 data");
*err = result;
return 0;
}
if(nread == 0) {
failf(data, "Unexpected EOF");
*err = CURLE_RECV_ERROR;