diff --git a/include/multiplexed_socket.h b/include/multiplexed_socket.h index a090a8c9a03830dcf18b27af054c7c8a5f44102e..e265db9e3e605c9f1c64898a97e0ad590f5c8fd5 100644 --- a/include/multiplexed_socket.h +++ b/include/multiplexed_socket.h @@ -79,7 +79,7 @@ struct ChannelRequest class MultiplexedSocket : public std::enable_shared_from_this<MultiplexedSocket> { public: - MultiplexedSocket(std::shared_ptr<asio::io_context> ctx, const DeviceId& deviceId, std::unique_ptr<TlsSocketEndpoint> endpoint); + MultiplexedSocket(std::shared_ptr<asio::io_context> ctx, const DeviceId& deviceId, std::unique_ptr<TlsSocketEndpoint> endpoint, std::shared_ptr<dht::log::Logger> logger = {}); ~MultiplexedSocket(); std::shared_ptr<ChannelSocket> addChannel(const std::string& name); diff --git a/src/connectionmanager.cpp b/src/connectionmanager.cpp index 2b6e54452f44b317247d3f7336eb84205b0300fc..f852661bf43f2e50bb2e131f22aa5f4771456614 100644 --- a/src/connectionmanager.cpp +++ b/src/connectionmanager.cpp @@ -1256,7 +1256,7 @@ ConnectionManager::Impl::onDhtPeerRequest(const PeerConnectionRequest& req, void ConnectionManager::Impl::addNewMultiplexedSocket(const CallbackId& id, const std::shared_ptr<ConnectionInfo>& info) { - info->socket_ = std::make_shared<MultiplexedSocket>(config_->ioContext, id.first, std::move(info->tls_)); + info->socket_ = std::make_shared<MultiplexedSocket>(config_->ioContext, id.first, std::move(info->tls_), config_->logger); info->socket_->setOnReady( [w = weak()](const DeviceId& deviceId, const std::shared_ptr<ChannelSocket>& socket) { if (auto sthis = w.lock()) diff --git a/src/multiplexed_socket.cpp b/src/multiplexed_socket.cpp index 28e5c111453b309ba6e5f819e1958356b77939c8..154741b4132cd2df7382ea0d7b7a1b48dcc45df2 100644 --- a/src/multiplexed_socket.cpp +++ b/src/multiplexed_socket.cpp @@ -60,7 +60,8 @@ public: Impl(MultiplexedSocket& parent, std::shared_ptr<asio::io_context> ctx, const DeviceId& deviceId, - std::unique_ptr<TlsSocketEndpoint> endpoint) + std::unique_ptr<TlsSocketEndpoint> endpoint, + std::shared_ptr<dht::log::Logger> logger) : parent_(parent) , ctx_(std::move(ctx)) , deviceId(deviceId) @@ -541,8 +542,8 @@ MultiplexedSocket::Impl::handleProtocolPacket(std::vector<uint8_t>&& pkt) } MultiplexedSocket::MultiplexedSocket(std::shared_ptr<asio::io_context> ctx, const DeviceId& deviceId, - std::unique_ptr<TlsSocketEndpoint> endpoint) - : pimpl_(std::make_unique<Impl>(*this, ctx, deviceId, std::move(endpoint))) + std::unique_ptr<TlsSocketEndpoint> endpoint, std::shared_ptr<dht::log::Logger> logger) + : pimpl_(std::make_unique<Impl>(*this, ctx, deviceId, std::move(endpoint), logger)) {} MultiplexedSocket::~MultiplexedSocket() {}