Skip to content
Snippets Groups Projects
Commit 24efa378 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

http: cleanup

parent c0f14ca5
No related branches found
No related tags found
No related merge requests found
...@@ -920,10 +920,7 @@ Request::handle_response(const asio::error_code& ec, size_t n_bytes) ...@@ -920,10 +920,7 @@ Request::handle_response(const asio::error_code& ec, size_t n_bytes)
} }
if (state_ != State::DONE and parser_ and not http_body_is_final(parser_.get())) { if (state_ != State::DONE and parser_ and not http_body_is_final(parser_.get())) {
if (auto toRead = parser_->content_length ? std::min<uint64_t>(parser_->content_length, 64 * 1024) : 64 * 1024) { auto toRead = parser_->content_length ? std::min<uint64_t>(parser_->content_length, 64 * 1024) : 64 * 1024;
if (logger_)
logger_->d("[http:request:%i] read more %llu", id_, toRead);
std::weak_ptr<Request> wthis = shared_from_this(); std::weak_ptr<Request> wthis = shared_from_this();
conn_->async_read_some(toRead, [wthis](const asio::error_code& ec, size_t bytes){ conn_->async_read_some(toRead, [wthis](const asio::error_code& ec, size_t bytes){
if (auto sthis = wthis.lock()) if (auto sthis = wthis.lock())
...@@ -931,7 +928,6 @@ Request::handle_response(const asio::error_code& ec, size_t n_bytes) ...@@ -931,7 +928,6 @@ Request::handle_response(const asio::error_code& ec, size_t n_bytes)
}); });
} }
} }
}
void void
Request::onBody(const char* at, size_t length) Request::onBody(const char* at, size_t length)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment