diff --git a/server_http.hpp b/server_http.hpp index 0bd45f5..7d8c27e 100644 --- a/server_http.hpp +++ b/server_http.hpp @@ -268,7 +268,7 @@ namespace SimpleWeb { std::shared_ptr socket; std::shared_ptr request; - std::shared_ptr timer; + std::unique_ptr timer; void set_timeout(long seconds) { if(seconds == 0) { @@ -276,7 +276,7 @@ namespace SimpleWeb { return; } - timer = std::make_shared(socket->get_io_service()); + timer = std::unique_ptr(new asio::deadline_timer(socket->get_io_service())); timer->expires_from_now(boost::posix_time::seconds(seconds)); auto socket = this->socket; timer->async_wait([socket](const error_code &ec) {