diff options
author | Oleg Morozenkov <omorozenkov@gmail.com> | 2018-05-26 16:16:13 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-26 16:16:13 +0300 |
commit | b538f1fb43c790c9043630e6bfad42f037dbe03a (patch) | |
tree | e932ad8f364ddfa108e633a3624371a569936fdb /include/tgbot/net/HttpServer.h | |
parent | 987adf188619011acff2052301245e4df22a38d2 (diff) | |
parent | ad40032ec5608af2fd94b28cbfe498a7313c3af0 (diff) |
Merge pull request #60 from JellyBrick/master
Improve performance
Diffstat (limited to 'include/tgbot/net/HttpServer.h')
-rw-r--r-- | include/tgbot/net/HttpServer.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/tgbot/net/HttpServer.h b/include/tgbot/net/HttpServer.h index 164bd2b..d68599f 100644 --- a/include/tgbot/net/HttpServer.h +++ b/include/tgbot/net/HttpServer.h @@ -51,8 +51,8 @@ public: * Starts receiving new connections. */ void start() { - std::shared_ptr<boost::asio::basic_stream_socket<Protocol>> socket(new boost::asio::basic_stream_socket<Protocol>(_acceptor->get_io_service())); - std::shared_ptr<Connection> connection(new Connection(socket, _handler)); + auto socket(std::make_shared<boost::asio::basic_stream_socket<Protocol>>(_acceptor->get_io_service())); + auto connection(std::make_shared<Connection>(socket, _handler)); _acceptor->async_accept(*connection->socket, [this, connection]() { connection->start(); start(); |