Commit 048f8463 authored by Jay Satiro's avatar Jay Satiro
Browse files

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.
parent d30ad55c
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
@@ -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) {
        if(result != CURLE_AGAIN)
          failf(data, "Failed receiving HTTP2 data");
        *err = result;
        return 0;
        return -1;
      }

      if(nread == 0) {