]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
http2: Don't increment drain when one header field is received
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>
Wed, 24 Feb 2016 13:10:37 +0000 (22:10 +0900)
committerJay Satiro <raysatiro@yahoo.com>
Tue, 12 Apr 2016 01:43:29 +0000 (21:43 -0400)
Sicne we write header field in temporary location, not in the memory
that upper layer provides, incrementing drain should not happen.

Ref: https://github.com/curl/curl/issues/659
Ref: https://github.com/curl/curl/pull/663

lib/http2.c

index 5e9adf2404fab78a94ef46b72cbd4a9ac92bfdd9..73470f8e72bc3ce3bea52e37eff6bdfe0c750ed8 100644 (file)
@@ -848,8 +848,6 @@ static int on_header(nghttp2_session *session, const nghttp2_frame *frame,
     Curl_add_buffer(stream->header_recvbuf, value, valuelen);
     /* the space character after the status code is mandatory */
     Curl_add_buffer(stream->header_recvbuf, " \r\n", 3);
-    data_s->state.drain++;
-    conn->proto.httpc.drain_total++;
     /* if we receive data for another handle, wake that up */
     if(conn->data != data_s)
       Curl_expire(data_s, 1);
@@ -866,8 +864,6 @@ static int on_header(nghttp2_session *session, const nghttp2_frame *frame,
   Curl_add_buffer(stream->header_recvbuf, ":", 1);
   Curl_add_buffer(stream->header_recvbuf, value, valuelen);
   Curl_add_buffer(stream->header_recvbuf, "\r\n", 2);
-  data_s->state.drain++;
-  conn->proto.httpc.drain_total++;
   /* if we receive data for another handle, wake that up */
   if(conn->data != data_s)
     Curl_expire(data_s, 1);