From 0dc0de0351a43ac70fabf6032be76e822ad7f8b4 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Thu, 7 May 2015 17:22:57 +0900 Subject: 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. --- lib/http.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/http.h') 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 -- cgit v1.2.3