aboutsummaryrefslogtreecommitdiff
path: root/lib/http.h
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2015-05-07 17:22:57 +0900
committerDaniel Stenberg <daniel@haxx.se>2015-05-18 08:57:18 +0200
commit0dc0de0351a43ac70fabf6032be76e822ad7f8b4 (patch)
treed88faf9ff747a6be6ffd2dce1d271325b0ae1090 /lib/http.h
parentd261652d422b0724406d03df8ff753ac7a20b7b6 (diff)
http2: Read data left in connection buffer after pause
Previously when we do pause because of out of buffer, we just throw away unread data in connection buffer. This just broke protocol framing, and I saw occasional FRAME_SIZE_ERROR. This commit fix this issue by remembering how much data read, and in the next iteration, we process remaining data.
Diffstat (limited to 'lib/http.h')
-rw-r--r--lib/http.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/http.h b/lib/http.h
index 53d2bfeba..13fa1d99b 100644
--- a/lib/http.h
+++ b/lib/http.h
@@ -191,6 +191,8 @@ struct http_conn {
sending send_underlying; /* underlying send Curl_send callback */
recving recv_underlying; /* underlying recv Curl_recv callback */
char *inbuf; /* buffer to receive data from underlying socket */
+ size_t inbuflen; /* number of bytes filled in inbuf */
+ size_t nread_inbuf; /* number of bytes read from in inbuf */
/* We need separate buffer for transmission and reception because we
may call nghttp2_session_send() after the
nghttp2_session_mem_recv() but mem buffer is still not full. In