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

Commit

Permalink
compile clean with gcc 4.6.3
Browse files Browse the repository at this point in the history
  • Loading branch information
ntadas committed Dec 12, 2016
1 parent dc7762e commit dc74f77
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions server_http.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ namespace SimpleWeb {
}

//Set timeout on the following boost::asio::async-read or write function
auto timer=get_timeout_timer(socket, timeout_request);
auto timer=this->get_timeout_timer(socket, timeout_request);

boost::asio::async_read_until(*socket, request->streambuf, "\r\n\r\n",
[this, socket, request, timer](const boost::system::error_code& ec, size_t bytes_transferred) {
Expand All @@ -255,7 +255,7 @@ namespace SimpleWeb {
//streambuf (maybe some bytes of the content) is appended to in the async_read-function below (for retrieving content).
size_t num_additional_bytes=request->streambuf.size()-bytes_transferred;

if(!parse_request(request))
if(!this->parse_request(request))
return;

//If content, read that as well
Expand All @@ -272,22 +272,22 @@ namespace SimpleWeb {
}
if(content_length>num_additional_bytes) {
//Set timeout on the following boost::asio::async-read or write function
auto timer=get_timeout_timer(socket, timeout_content);
auto timer=this->get_timeout_timer(socket, timeout_content);
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(timer)
timer->cancel();
if(!ec)
find_resource(socket, request);
this->find_resource(socket, request);
});
}
else
find_resource(socket, request);
this->find_resource(socket, request);
}
else
find_resource(socket, request);
this->find_resource(socket, request);
}
});
}
Expand Down Expand Up @@ -357,11 +357,11 @@ namespace SimpleWeb {
std::function<void(std::shared_ptr<typename ServerBase<socket_type>::Response>,
std::shared_ptr<typename ServerBase<socket_type>::Request>)>& resource_function) {
//Set timeout on the following boost::asio::async-read or write function
auto timer=get_timeout_timer(socket, timeout_content);
auto timer=this->get_timeout_timer(socket, timeout_content);

auto response=std::shared_ptr<Response>(new Response(socket), [this, request, timer](Response *response_ptr) {
auto response=std::shared_ptr<Response>(response_ptr);
send(response, [this, response, request, timer](const boost::system::error_code& ec) {
this->send(response, [this, response, request, timer](const boost::system::error_code& ec) {
if(timer)
timer->cancel();
if(!ec) {
Expand All @@ -381,7 +381,7 @@ namespace SimpleWeb {
return;
}
if(http_version>1.05)
read_request_and_content(response->socket);
this->read_request_and_content(response->socket);
}
});
});
Expand Down Expand Up @@ -423,7 +423,7 @@ namespace SimpleWeb {
boost::asio::ip::tcp::no_delay option(true);
socket->set_option(option);

read_request_and_content(socket);
this->read_request_and_content(socket);
}
});
}
Expand Down

0 comments on commit dc74f77

Please sign in to comment.