Loading asio_compatibility.hpp +3 −3 Original line number Diff line number Diff line Loading @@ -42,9 +42,9 @@ namespace SimpleWeb { inline asio::ip::address make_address(const std::string &str) noexcept { return asio::ip::make_address(str); } template <typename socket_type> asio::executor get_socket_executor(socket_type &socket) { return socket.get_executor(); template <typename socket_type, typename duration_type> asio::steady_timer make_steady_timer(socket_type &socket, std::chrono::duration<duration_type> duration) { return asio::steady_timer(socket.get_executor(), duration); } template <typename handler_type> void async_resolve(asio::ip::tcp::resolver &resolver, const std::pair<std::string, std::string> &host_port, handler_type &&handler) { Loading client_http.hpp +1 −1 Original line number Diff line number Diff line Loading @@ -173,7 +173,7 @@ namespace SimpleWeb { timer = nullptr; return; } timer = std::unique_ptr<asio::steady_timer>(new asio::steady_timer(get_socket_executor(*socket), std::chrono::seconds(seconds))); timer = std::unique_ptr<asio::steady_timer>(new asio::steady_timer(make_steady_timer(*socket, std::chrono::seconds(seconds)))); std::weak_ptr<Connection> self_weak(this->shared_from_this()); // To avoid keeping Connection instance alive longer than needed timer->async_wait([self_weak](const error_code &ec) { if(!ec) { Loading server_http.hpp +1 −1 Original line number Diff line number Diff line Loading @@ -303,7 +303,7 @@ namespace SimpleWeb { return; } timer = std::unique_ptr<asio::steady_timer>(new asio::steady_timer(get_socket_executor(*socket), std::chrono::seconds(seconds))); timer = std::unique_ptr<asio::steady_timer>(new asio::steady_timer(make_steady_timer(*socket, std::chrono::seconds(seconds)))); std::weak_ptr<Connection> self_weak(this->shared_from_this()); // To avoid keeping Connection instance alive longer than needed timer->async_wait([self_weak](const error_code &ec) { if(!ec) { Loading Loading
asio_compatibility.hpp +3 −3 Original line number Diff line number Diff line Loading @@ -42,9 +42,9 @@ namespace SimpleWeb { inline asio::ip::address make_address(const std::string &str) noexcept { return asio::ip::make_address(str); } template <typename socket_type> asio::executor get_socket_executor(socket_type &socket) { return socket.get_executor(); template <typename socket_type, typename duration_type> asio::steady_timer make_steady_timer(socket_type &socket, std::chrono::duration<duration_type> duration) { return asio::steady_timer(socket.get_executor(), duration); } template <typename handler_type> void async_resolve(asio::ip::tcp::resolver &resolver, const std::pair<std::string, std::string> &host_port, handler_type &&handler) { Loading
client_http.hpp +1 −1 Original line number Diff line number Diff line Loading @@ -173,7 +173,7 @@ namespace SimpleWeb { timer = nullptr; return; } timer = std::unique_ptr<asio::steady_timer>(new asio::steady_timer(get_socket_executor(*socket), std::chrono::seconds(seconds))); timer = std::unique_ptr<asio::steady_timer>(new asio::steady_timer(make_steady_timer(*socket, std::chrono::seconds(seconds)))); std::weak_ptr<Connection> self_weak(this->shared_from_this()); // To avoid keeping Connection instance alive longer than needed timer->async_wait([self_weak](const error_code &ec) { if(!ec) { Loading
server_http.hpp +1 −1 Original line number Diff line number Diff line Loading @@ -303,7 +303,7 @@ namespace SimpleWeb { return; } timer = std::unique_ptr<asio::steady_timer>(new asio::steady_timer(get_socket_executor(*socket), std::chrono::seconds(seconds))); timer = std::unique_ptr<asio::steady_timer>(new asio::steady_timer(make_steady_timer(*socket, std::chrono::seconds(seconds)))); std::weak_ptr<Connection> self_weak(this->shared_from_this()); // To avoid keeping Connection instance alive longer than needed timer->async_wait([self_weak](const error_code &ec) { if(!ec) { Loading