]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
http2: Fix http2_recv to return -1 if recv returned -1
authorJay Satiro <raysatiro@yahoo.com>
Thu, 8 Oct 2015 06:48:44 +0000 (02:48 -0400)
committerJay Satiro <raysatiro@yahoo.com>
Fri, 9 Oct 2015 04:29:25 +0000 (00:29 -0400)
If the underlying recv called by http2_recv returns -1 then that is the
value http2_recv returns to the caller.

lib/http2.c

index de6d03d39de497cc53caafbd9b55def3d8adbf74..bd29a926b142af63535e724048155d20688a2824 100644 (file)
@@ -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) {