aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2014-01-30 17:49:35 +0100
committerDaniel Stenberg <daniel@haxx.se>2014-01-30 17:49:35 +0100
commitc5165b84589a9bbf3567fde19add3819fd71e1b2 (patch)
treec88a343ff5ba5579828c07ec8bed1d1bfc5e9b50 /lib
parent88705ef80efcb5ee3ef75aea6f037f56f7e6dda1 (diff)
http2_recv: Return written length on CURLE_AGAIN
Diffstat (limited to 'lib')
-rw-r--r--lib/http2.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/http2.c b/lib/http2.c
index 214b46961..019518514 100644
--- a/lib/http2.c
+++ b/lib/http2.c
@@ -372,8 +372,11 @@ static ssize_t http2_recv(struct connectdata *conn, int sockindex,
rc = Curl_read_plain(conn->sock[FIRSTSOCKET], inbuf, H2_BUFSIZE, &nread);
if(rc == CURLE_AGAIN) {
- *err = rc;
- return -1;
+ if(len == conn->proto.httpc.len) {
+ *err = rc;
+ return 0;
+ }
+ return len - conn->proto.httpc.len;
}
if(rc) {
failf(conn->data, "Failed receiving HTTP2 data");