Skip to content

Commit

Permalink
fix: allow parsing multiple requests from the same http connection (#235
Browse files Browse the repository at this point in the history
)

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
  • Loading branch information
romange authored Mar 24, 2024
1 parent 23eb572 commit ceaa6f8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions util/http/http_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ error_code HttpConnection::ParseFromBuffer(io::Bytes buf) {
cntx.set_user_data(user_data_);

while (!buf.empty()) {
ParserType parser{std::move(request)};
ParserType parser;
parser.eager(true);

size_t consumed = parser.put(boost::asio::const_buffer{buf.data(), buf.size()}, ec);
Expand Down Expand Up @@ -356,7 +356,7 @@ void HttpConnection::HandleRequests() {
cntx.set_user_data(user_data_);

while (true) {
ParserType parser{std::move(request)};
ParserType parser;
parser.eager(true);

h2::read(asa, req_buffer_, parser, ec);
Expand Down

0 comments on commit ceaa6f8

Please sign in to comment.