diff --git a/src/HttpServer.cc b/src/HttpServer.cc index 84c82474..1dcaaa18 100644 --- a/src/HttpServer.cc +++ b/src/HttpServer.cc @@ -271,6 +271,7 @@ void connhd_readcb(bufferevent *bev, void *ptr) return; } leftlen -= readlen; + handler->set_left_connhd_len(leftlen); if(leftlen == 0) { bufferevent_setcb(bev, readcb, writecb, eventcb, ptr); // Run on_read to process data left in buffer since they are not @@ -507,6 +508,11 @@ size_t Http2Handler::get_left_connhd_len() const return left_connhd_len_; } +void Http2Handler::set_left_connhd_len(size_t left) +{ + left_connhd_len_ = left; +} + namespace { ssize_t hd_send_callback(nghttp2_session *session, const uint8_t *data, size_t len, int flags, diff --git a/src/HttpServer.h b/src/HttpServer.h index 0f2f4734..216ab971 100644 --- a/src/HttpServer.h +++ b/src/HttpServer.h @@ -111,6 +111,7 @@ public: Sessions* get_sessions() const; const Config* get_config() const; size_t get_left_connhd_len() const; + void set_left_connhd_len(size_t left); private: nghttp2_session *session_; Sessions *sessions_;