diff options
author | ipknHama <ipknhama@gmail.com> | 2014-07-29 20:20:50 +0900 |
---|---|---|
committer | ipknHama <ipknhama@gmail.com> | 2014-07-29 20:20:50 +0900 |
commit | b7781b20ff8675ca0c860b017f3c3e7817b6eb37 (patch) | |
tree | 34685a9625b07406260417c9aee34ed127e80ccb /http_server.h | |
parent | 404b0b966ee85ffab87383610d48310e3ef6c537 (diff) | |
download | crow-b7781b20ff8675ca0c860b017f3c3e7817b6eb37.tar.gz crow-b7781b20ff8675ca0c860b017f3c3e7817b6eb37.zip |
Add HTTP/1.1 persistent connection timeout
manage Connection object life cycle using shared_ptr
Diffstat (limited to 'http_server.h')
-rw-r--r-- | http_server.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/http_server.h b/http_server.h index 6cf8f4f..9381fdb 100644 --- a/http_server.h +++ b/http_server.h @@ -4,6 +4,8 @@ #include <cstdint> #include <atomic> +#include <memory> + #include "http_connection.h" #include "datetime.h" #include "logging.h" @@ -57,7 +59,10 @@ namespace crow [this](boost::system::error_code ec) { if (!ec) - (new Connection<Handler>(std::move(socket_), handler_, server_name_))->start(); + { + auto p = std::make_shared<Connection<Handler>>(std::move(socket_), handler_, server_name_); + p->start(); + } do_accept(); }); } |