Skip to content
This repository has been archived by the owner on Jun 12, 2018. It is now read-only.

Commit

Permalink
Fixes #28
Browse files Browse the repository at this point in the history
  • Loading branch information
eidheim committed Dec 9, 2015
1 parent 25cf952 commit faf3c68
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions server_http.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,15 +249,22 @@ namespace SimpleWeb {
catch(const std::exception &e) {
return;
}
boost::asio::async_read(*socket, request->streambuf,
boost::asio::transfer_exactly(content_length-num_additional_bytes),
[this, socket, request, timer]
(const boost::system::error_code& ec, size_t /*bytes_transferred*/) {
if(content_length>num_additional_bytes) {
boost::asio::async_read(*socket, request->streambuf,
boost::asio::transfer_exactly(content_length-num_additional_bytes),
[this, socket, request, timer]
(const boost::system::error_code& ec, size_t /*bytes_transferred*/) {
if(timeout_content>0)
timer->cancel();
if(!ec)
find_resource(socket, request);
});
}
else {
if(timeout_content>0)
timer->cancel();
if(!ec)
find_resource(socket, request);
});
find_resource(socket, request);
}
}
else {
find_resource(socket, request);
Expand Down

0 comments on commit faf3c68

Please sign in to comment.