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:
parent
d30ad55c59
commit
048f84637f
10
lib/http2.c
10
lib/http2.c
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user