diff options
Diffstat (limited to 'include/tgbot/net')
-rw-r--r-- | include/tgbot/net/HttpServer.h | 4 | ||||
-rw-r--r-- | include/tgbot/net/TgWebhookLocalServer.h | 2 |
2 files changed, 3 insertions, 3 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(); diff --git a/include/tgbot/net/TgWebhookLocalServer.h b/include/tgbot/net/TgWebhookLocalServer.h index 67268f5..99a0fba 100644 --- a/include/tgbot/net/TgWebhookLocalServer.h +++ b/include/tgbot/net/TgWebhookLocalServer.h @@ -39,7 +39,7 @@ public: TgWebhookLocalServer(std::shared_ptr<boost::asio::basic_socket_acceptor<boost::asio::local::stream_protocol>>& acceptor, const std::string& path, EventHandler* eventHandler) = delete; TgWebhookLocalServer(const std::string& path, const EventHandler* eventHandler) : - TgWebhookServer<boost::asio::local::stream_protocol>(std::shared_ptr<boost::asio::basic_socket_acceptor<boost::asio::local::stream_protocol>>(new boost::asio::local::stream_protocol::acceptor(_ioService, boost::asio::local::stream_protocol::endpoint(path))), path, eventHandler) + TgWebhookServer<boost::asio::local::stream_protocol>(std::make_shared<boost::asio::basic_socket_acceptor<boost::asio::local::stream_protocol>>(_ioService, boost::asio::local::stream_protocol::endpoint(path)), path, eventHandler) { } |