2020-05-22 13:18:41 +00:00
|
|
|
/*
|
2023-06-12 02:10:32 +00:00
|
|
|
* Copyright (c) 2013-2023, The PurpleI2P Project
|
2020-05-22 13:18:41 +00:00
|
|
|
*
|
|
|
|
* This file is part of Purple i2pd project and licensed under BSD3
|
|
|
|
*
|
|
|
|
* See full license text in LICENSE file at top of project tree
|
|
|
|
*/
|
|
|
|
|
2015-01-07 18:09:59 +00:00
|
|
|
#include "Destination.h"
|
|
|
|
#include "Identity.h"
|
|
|
|
#include "ClientContext.h"
|
|
|
|
#include "I2PService.h"
|
2017-08-31 16:08:22 +00:00
|
|
|
#include <boost/asio/error.hpp>
|
2015-01-07 18:09:59 +00:00
|
|
|
|
|
|
|
namespace i2p
|
|
|
|
{
|
|
|
|
namespace client
|
|
|
|
{
|
2018-12-06 18:13:20 +00:00
|
|
|
static const i2p::data::SigningKeyType I2P_SERVICE_DEFAULT_KEY_TYPE = i2p::data::SIGNING_KEY_TYPE_EDDSA_SHA512_ED25519;
|
2015-01-07 18:09:59 +00:00
|
|
|
|
2015-02-24 20:40:50 +00:00
|
|
|
I2PService::I2PService (std::shared_ptr<ClientDestination> localDestination):
|
2015-01-07 18:09:59 +00:00
|
|
|
m_LocalDestination (localDestination ? localDestination :
|
2017-08-31 16:08:22 +00:00
|
|
|
i2p::client::context.CreateNewLocalDestination (false, I2P_SERVICE_DEFAULT_KEY_TYPE)),
|
2017-10-04 17:15:29 +00:00
|
|
|
m_ReadyTimer(m_LocalDestination->GetService()),
|
2018-05-28 21:00:47 +00:00
|
|
|
m_ReadyTimerTriggered(false),
|
2017-10-04 17:15:29 +00:00
|
|
|
m_ConnectTimeout(0),
|
2017-08-31 16:08:22 +00:00
|
|
|
isUpdated (true)
|
2015-01-07 18:09:59 +00:00
|
|
|
{
|
2017-08-31 16:08:22 +00:00
|
|
|
m_LocalDestination->Acquire ();
|
2015-01-07 18:09:59 +00:00
|
|
|
}
|
2017-08-31 16:08:22 +00:00
|
|
|
|
2015-01-07 20:15:04 +00:00
|
|
|
I2PService::I2PService (i2p::data::SigningKeyType kt):
|
2017-07-28 19:12:15 +00:00
|
|
|
m_LocalDestination (i2p::client::context.CreateNewLocalDestination (false, kt)),
|
2017-08-31 16:08:22 +00:00
|
|
|
m_ReadyTimer(m_LocalDestination->GetService()),
|
|
|
|
m_ConnectTimeout(0),
|
2017-07-28 19:12:15 +00:00
|
|
|
isUpdated (true)
|
2015-01-07 20:15:04 +00:00
|
|
|
{
|
2017-07-06 20:12:06 +00:00
|
|
|
m_LocalDestination->Acquire ();
|
2015-01-07 20:15:04 +00:00
|
|
|
}
|
2017-08-31 16:08:22 +00:00
|
|
|
|
|
|
|
I2PService::~I2PService ()
|
|
|
|
{
|
|
|
|
ClearHandlers ();
|
|
|
|
if (m_LocalDestination) m_LocalDestination->Release ();
|
2017-07-06 20:12:06 +00:00
|
|
|
}
|
|
|
|
|
2017-08-11 00:29:35 +00:00
|
|
|
void I2PService::ClearHandlers ()
|
|
|
|
{
|
2017-08-31 16:08:22 +00:00
|
|
|
if(m_ConnectTimeout)
|
|
|
|
m_ReadyTimer.cancel();
|
2017-08-11 00:29:35 +00:00
|
|
|
std::unique_lock<std::mutex> l(m_HandlersMutex);
|
|
|
|
for (auto it: m_Handlers)
|
|
|
|
it->Terminate ();
|
|
|
|
m_Handlers.clear();
|
|
|
|
}
|
2017-08-31 16:08:22 +00:00
|
|
|
|
|
|
|
void I2PService::SetConnectTimeout(uint32_t timeout)
|
|
|
|
{
|
|
|
|
m_ConnectTimeout = timeout;
|
|
|
|
}
|
|
|
|
|
|
|
|
void I2PService::AddReadyCallback(ReadyCallback cb)
|
|
|
|
{
|
|
|
|
uint32_t now = i2p::util::GetSecondsSinceEpoch();
|
2018-05-28 21:00:47 +00:00
|
|
|
uint32_t tm = (m_ConnectTimeout) ? now + m_ConnectTimeout : NEVER_TIMES_OUT;
|
|
|
|
|
2017-08-31 16:08:22 +00:00
|
|
|
LogPrint(eLogDebug, "I2PService::AddReadyCallback() ", tm, " ", now);
|
|
|
|
m_ReadyCallbacks.push_back({cb, tm});
|
2018-05-28 21:00:47 +00:00
|
|
|
if (!m_ReadyTimerTriggered) TriggerReadyCheckTimer();
|
2017-08-31 16:08:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void I2PService::TriggerReadyCheckTimer()
|
|
|
|
{
|
|
|
|
m_ReadyTimer.expires_from_now(boost::posix_time::seconds (1));
|
2018-12-07 17:25:26 +00:00
|
|
|
m_ReadyTimer.async_wait(std::bind(&I2PService::HandleReadyCheckTimer, shared_from_this (), std::placeholders::_1));
|
2018-05-28 21:00:47 +00:00
|
|
|
m_ReadyTimerTriggered = true;
|
|
|
|
|
2017-08-31 16:08:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void I2PService::HandleReadyCheckTimer(const boost::system::error_code &ec)
|
|
|
|
{
|
|
|
|
if(ec || m_LocalDestination->IsReady())
|
|
|
|
{
|
|
|
|
for(auto & itr : m_ReadyCallbacks)
|
|
|
|
itr.first(ec);
|
|
|
|
m_ReadyCallbacks.clear();
|
|
|
|
}
|
|
|
|
else if(!m_LocalDestination->IsReady())
|
|
|
|
{
|
|
|
|
// expire timed out requests
|
|
|
|
uint32_t now = i2p::util::GetSecondsSinceEpoch ();
|
|
|
|
auto itr = m_ReadyCallbacks.begin();
|
|
|
|
while(itr != m_ReadyCallbacks.end())
|
|
|
|
{
|
2020-05-04 23:36:34 +00:00
|
|
|
if(itr->second != NEVER_TIMES_OUT && now >= itr->second)
|
2017-08-31 16:08:22 +00:00
|
|
|
{
|
|
|
|
itr->first(boost::asio::error::timed_out);
|
|
|
|
itr = m_ReadyCallbacks.erase(itr);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
++itr;
|
|
|
|
}
|
|
|
|
}
|
2018-05-28 21:00:47 +00:00
|
|
|
if(!ec && m_ReadyCallbacks.size())
|
2020-05-04 23:36:34 +00:00
|
|
|
TriggerReadyCheckTimer();
|
2018-05-28 21:00:47 +00:00
|
|
|
else
|
2020-05-04 23:36:34 +00:00
|
|
|
m_ReadyTimerTriggered = false;
|
2017-08-31 16:08:22 +00:00
|
|
|
}
|
|
|
|
|
2023-06-12 02:10:32 +00:00
|
|
|
void I2PService::CreateStream (StreamRequestComplete streamRequestComplete, const std::string& dest, uint16_t port) {
|
2015-01-07 19:44:24 +00:00
|
|
|
assert(streamRequestComplete);
|
2019-03-28 13:57:34 +00:00
|
|
|
auto address = i2p::client::context.GetAddressBook ().GetAddress (dest);
|
|
|
|
if (address)
|
|
|
|
CreateStream(streamRequestComplete, address, port);
|
2015-01-07 19:44:24 +00:00
|
|
|
else
|
|
|
|
{
|
2016-06-03 00:00:00 +00:00
|
|
|
LogPrint (eLogWarning, "I2PService: Remote destination not found: ", dest);
|
2015-01-07 19:44:24 +00:00
|
|
|
streamRequestComplete (nullptr);
|
|
|
|
}
|
|
|
|
}
|
2015-01-08 00:31:31 +00:00
|
|
|
|
2023-06-12 02:10:32 +00:00
|
|
|
void I2PService::CreateStream(StreamRequestComplete streamRequestComplete, std::shared_ptr<const Address> address, uint16_t port)
|
2017-08-31 16:08:22 +00:00
|
|
|
{
|
2019-03-28 13:57:34 +00:00
|
|
|
if(m_ConnectTimeout && !m_LocalDestination->IsReady())
|
2017-08-31 16:08:22 +00:00
|
|
|
{
|
2020-03-01 10:25:50 +00:00
|
|
|
AddReadyCallback([this, streamRequestComplete, address, port] (const boost::system::error_code & ec)
|
|
|
|
{
|
2019-03-28 13:57:34 +00:00
|
|
|
if(ec)
|
|
|
|
{
|
2020-05-04 23:36:34 +00:00
|
|
|
LogPrint(eLogWarning, "I2PService::CreateStream() ", ec.message());
|
2019-03-28 13:57:34 +00:00
|
|
|
streamRequestComplete(nullptr);
|
|
|
|
}
|
|
|
|
else
|
2020-03-01 10:25:50 +00:00
|
|
|
{
|
|
|
|
if (address->IsIdentHash ())
|
2019-03-28 13:57:34 +00:00
|
|
|
this->m_LocalDestination->CreateStream(streamRequestComplete, address->identHash, port);
|
2017-08-31 16:08:22 +00:00
|
|
|
else
|
2020-03-01 10:25:50 +00:00
|
|
|
this->m_LocalDestination->CreateStream (streamRequestComplete, address->blindedPublicKey, port);
|
2019-03-28 13:57:34 +00:00
|
|
|
}
|
|
|
|
});
|
2017-08-31 16:08:22 +00:00
|
|
|
}
|
|
|
|
else
|
2020-03-01 10:25:50 +00:00
|
|
|
{
|
2019-03-28 13:57:34 +00:00
|
|
|
if (address->IsIdentHash ())
|
|
|
|
m_LocalDestination->CreateStream (streamRequestComplete, address->identHash, port);
|
|
|
|
else
|
|
|
|
m_LocalDestination->CreateStream (streamRequestComplete, address->blindedPublicKey, port);
|
|
|
|
}
|
2017-08-31 16:08:22 +00:00
|
|
|
}
|
|
|
|
|
2016-07-28 13:25:05 +00:00
|
|
|
TCPIPPipe::TCPIPPipe(I2PService * owner, std::shared_ptr<boost::asio::ip::tcp::socket> upstream, std::shared_ptr<boost::asio::ip::tcp::socket> downstream) : I2PServiceHandler(owner), m_up(upstream), m_down(downstream)
|
|
|
|
{
|
|
|
|
boost::asio::socket_base::receive_buffer_size option(TCP_IP_PIPE_BUFFER_SIZE);
|
|
|
|
upstream->set_option(option);
|
|
|
|
downstream->set_option(option);
|
|
|
|
}
|
2016-02-26 22:06:11 +00:00
|
|
|
|
|
|
|
TCPIPPipe::~TCPIPPipe()
|
|
|
|
{
|
|
|
|
Terminate();
|
|
|
|
}
|
2017-08-31 16:08:22 +00:00
|
|
|
|
2016-02-26 22:06:11 +00:00
|
|
|
void TCPIPPipe::Start()
|
|
|
|
{
|
|
|
|
AsyncReceiveUpstream();
|
|
|
|
AsyncReceiveDownstream();
|
|
|
|
}
|
|
|
|
|
|
|
|
void TCPIPPipe::Terminate()
|
|
|
|
{
|
|
|
|
if(Kill()) return;
|
2017-10-04 17:15:29 +00:00
|
|
|
if (m_up)
|
|
|
|
{
|
|
|
|
if (m_up->is_open())
|
2016-02-26 22:06:11 +00:00
|
|
|
m_up->close();
|
|
|
|
m_up = nullptr;
|
|
|
|
}
|
2017-10-04 17:15:29 +00:00
|
|
|
if (m_down)
|
|
|
|
{
|
|
|
|
if (m_down->is_open())
|
2016-02-26 22:06:11 +00:00
|
|
|
m_down->close();
|
|
|
|
m_down = nullptr;
|
|
|
|
}
|
2016-11-20 17:13:11 +00:00
|
|
|
Done(shared_from_this());
|
2016-02-26 22:06:11 +00:00
|
|
|
}
|
2017-08-31 16:08:22 +00:00
|
|
|
|
2016-02-26 22:06:11 +00:00
|
|
|
void TCPIPPipe::AsyncReceiveUpstream()
|
|
|
|
{
|
2017-10-04 17:15:29 +00:00
|
|
|
if (m_up)
|
|
|
|
{
|
2016-02-26 22:06:11 +00:00
|
|
|
m_up->async_read_some(boost::asio::buffer(m_upstream_to_down_buf, TCP_IP_PIPE_BUFFER_SIZE),
|
2017-10-04 17:15:29 +00:00
|
|
|
std::bind(&TCPIPPipe::HandleUpstreamReceived, shared_from_this(),
|
2020-03-01 10:25:50 +00:00
|
|
|
std::placeholders::_1, std::placeholders::_2));
|
2016-02-26 22:06:11 +00:00
|
|
|
}
|
2017-10-04 17:15:29 +00:00
|
|
|
else
|
2021-11-27 19:53:53 +00:00
|
|
|
LogPrint(eLogError, "TCPIPPipe: Upstream receive: No socket");
|
2016-02-26 22:06:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void TCPIPPipe::AsyncReceiveDownstream()
|
|
|
|
{
|
|
|
|
if (m_down) {
|
|
|
|
m_down->async_read_some(boost::asio::buffer(m_downstream_to_up_buf, TCP_IP_PIPE_BUFFER_SIZE),
|
2017-10-04 17:15:29 +00:00
|
|
|
std::bind(&TCPIPPipe::HandleDownstreamReceived, shared_from_this(),
|
2020-03-01 10:25:50 +00:00
|
|
|
std::placeholders::_1, std::placeholders::_2));
|
2016-02-26 22:06:11 +00:00
|
|
|
}
|
2017-10-04 17:15:29 +00:00
|
|
|
else
|
2021-11-27 19:53:53 +00:00
|
|
|
LogPrint(eLogError, "TCPIPPipe: Downstream receive: No socket");
|
2016-02-26 22:06:11 +00:00
|
|
|
}
|
|
|
|
|
2016-11-20 17:13:11 +00:00
|
|
|
void TCPIPPipe::UpstreamWrite(size_t len)
|
2016-02-26 22:06:11 +00:00
|
|
|
{
|
2017-10-04 17:15:29 +00:00
|
|
|
if (m_up)
|
|
|
|
{
|
2021-11-27 19:53:53 +00:00
|
|
|
LogPrint(eLogDebug, "TCPIPPipe: Upstream: ", (int) len, " bytes written");
|
2016-11-20 17:13:11 +00:00
|
|
|
boost::asio::async_write(*m_up, boost::asio::buffer(m_upstream_buf, len),
|
2017-10-04 17:15:29 +00:00
|
|
|
boost::asio::transfer_all(),
|
|
|
|
std::bind(&TCPIPPipe::HandleUpstreamWrite,
|
2020-03-01 10:25:50 +00:00
|
|
|
shared_from_this(),
|
|
|
|
std::placeholders::_1));
|
2016-02-26 22:06:11 +00:00
|
|
|
}
|
2017-10-04 17:15:29 +00:00
|
|
|
else
|
2021-11-27 19:53:53 +00:00
|
|
|
LogPrint(eLogError, "TCPIPPipe: Upstream write: no socket");
|
2016-02-26 22:06:11 +00:00
|
|
|
}
|
|
|
|
|
2016-11-20 17:13:11 +00:00
|
|
|
void TCPIPPipe::DownstreamWrite(size_t len)
|
2016-02-26 22:06:11 +00:00
|
|
|
{
|
2017-10-04 17:15:29 +00:00
|
|
|
if (m_down)
|
|
|
|
{
|
2021-11-27 19:53:53 +00:00
|
|
|
LogPrint(eLogDebug, "TCPIPPipe: Downstream: ", (int) len, " bytes written");
|
2016-11-20 17:13:11 +00:00
|
|
|
boost::asio::async_write(*m_down, boost::asio::buffer(m_downstream_buf, len),
|
2017-10-04 17:15:29 +00:00
|
|
|
boost::asio::transfer_all(),
|
|
|
|
std::bind(&TCPIPPipe::HandleDownstreamWrite,
|
2020-03-01 10:25:50 +00:00
|
|
|
shared_from_this(),
|
|
|
|
std::placeholders::_1));
|
2016-02-26 22:06:11 +00:00
|
|
|
}
|
2017-10-04 17:15:29 +00:00
|
|
|
else
|
2021-11-27 19:53:53 +00:00
|
|
|
LogPrint(eLogError, "TCPIPPipe: Downstream write: No socket");
|
2016-02-26 22:06:11 +00:00
|
|
|
}
|
2017-08-31 16:08:22 +00:00
|
|
|
|
|
|
|
|
2016-02-26 22:06:11 +00:00
|
|
|
void TCPIPPipe::HandleDownstreamReceived(const boost::system::error_code & ecode, std::size_t bytes_transfered)
|
|
|
|
{
|
2021-11-27 19:53:53 +00:00
|
|
|
LogPrint(eLogDebug, "TCPIPPipe: Downstream: ", (int) bytes_transfered, " bytes received");
|
2017-10-04 17:15:29 +00:00
|
|
|
if (ecode)
|
|
|
|
{
|
2021-11-27 19:53:53 +00:00
|
|
|
LogPrint(eLogError, "TCPIPPipe: Downstream read error:" , ecode.message());
|
2016-02-26 22:06:11 +00:00
|
|
|
if (ecode != boost::asio::error::operation_aborted)
|
|
|
|
Terminate();
|
|
|
|
} else {
|
2017-10-04 17:15:29 +00:00
|
|
|
if (bytes_transfered > 0 )
|
2016-02-26 22:06:11 +00:00
|
|
|
memcpy(m_upstream_buf, m_downstream_to_up_buf, bytes_transfered);
|
2016-11-20 17:13:11 +00:00
|
|
|
UpstreamWrite(bytes_transfered);
|
2016-02-26 22:06:11 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void TCPIPPipe::HandleDownstreamWrite(const boost::system::error_code & ecode) {
|
2017-10-04 17:15:29 +00:00
|
|
|
if (ecode)
|
|
|
|
{
|
2021-11-27 19:53:53 +00:00
|
|
|
LogPrint(eLogError, "TCPIPPipe: Downstream write error:" , ecode.message());
|
2016-02-26 22:06:11 +00:00
|
|
|
if (ecode != boost::asio::error::operation_aborted)
|
|
|
|
Terminate();
|
|
|
|
}
|
2017-10-04 17:15:29 +00:00
|
|
|
else
|
|
|
|
AsyncReceiveUpstream();
|
2016-02-26 22:06:11 +00:00
|
|
|
}
|
2017-08-31 16:08:22 +00:00
|
|
|
|
2016-02-26 22:06:11 +00:00
|
|
|
void TCPIPPipe::HandleUpstreamWrite(const boost::system::error_code & ecode) {
|
2017-10-04 17:15:29 +00:00
|
|
|
if (ecode)
|
|
|
|
{
|
2021-11-27 19:53:53 +00:00
|
|
|
LogPrint(eLogError, "TCPIPPipe: Upstream write error:" , ecode.message());
|
2016-02-26 22:06:11 +00:00
|
|
|
if (ecode != boost::asio::error::operation_aborted)
|
|
|
|
Terminate();
|
|
|
|
}
|
2017-10-04 17:15:29 +00:00
|
|
|
else
|
|
|
|
AsyncReceiveDownstream();
|
2016-02-26 22:06:11 +00:00
|
|
|
}
|
2017-08-31 16:08:22 +00:00
|
|
|
|
2016-02-26 22:06:11 +00:00
|
|
|
void TCPIPPipe::HandleUpstreamReceived(const boost::system::error_code & ecode, std::size_t bytes_transfered)
|
|
|
|
{
|
2021-11-27 19:53:53 +00:00
|
|
|
LogPrint(eLogDebug, "TCPIPPipe: Upstream ", (int)bytes_transfered, " bytes received");
|
2017-10-04 17:15:29 +00:00
|
|
|
if (ecode)
|
|
|
|
{
|
2021-11-27 19:53:53 +00:00
|
|
|
LogPrint(eLogError, "TCPIPPipe: Upstream read error:" , ecode.message());
|
2016-02-26 22:06:11 +00:00
|
|
|
if (ecode != boost::asio::error::operation_aborted)
|
|
|
|
Terminate();
|
|
|
|
} else {
|
2017-10-04 17:15:29 +00:00
|
|
|
if (bytes_transfered > 0 )
|
2016-11-20 17:13:11 +00:00
|
|
|
memcpy(m_downstream_buf, m_upstream_to_down_buf, bytes_transfered);
|
|
|
|
DownstreamWrite(bytes_transfered);
|
2016-02-26 22:06:11 +00:00
|
|
|
}
|
|
|
|
}
|
2017-08-31 16:08:22 +00:00
|
|
|
|
2015-01-08 00:31:31 +00:00
|
|
|
void TCPIPAcceptor::Start ()
|
|
|
|
{
|
2017-08-03 01:00:04 +00:00
|
|
|
m_Acceptor.reset (new boost::asio::ip::tcp::acceptor (GetService (), m_LocalEndpoint));
|
2019-05-17 08:04:44 +00:00
|
|
|
// update the local end point in case port has been set zero and got updated now
|
2018-01-23 01:47:31 +00:00
|
|
|
m_LocalEndpoint = m_Acceptor->local_endpoint();
|
2020-05-04 23:36:34 +00:00
|
|
|
m_Acceptor->listen ();
|
|
|
|
Accept ();
|
2015-01-08 00:31:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void TCPIPAcceptor::Stop ()
|
|
|
|
{
|
2017-08-03 01:00:04 +00:00
|
|
|
if (m_Acceptor)
|
2017-08-31 16:08:22 +00:00
|
|
|
{
|
2017-08-03 01:00:04 +00:00
|
|
|
m_Acceptor->close();
|
|
|
|
m_Acceptor.reset (nullptr);
|
2017-08-31 16:08:22 +00:00
|
|
|
}
|
2015-01-08 00:31:31 +00:00
|
|
|
m_Timer.cancel ();
|
|
|
|
ClearHandlers();
|
|
|
|
}
|
|
|
|
|
|
|
|
void TCPIPAcceptor::Accept ()
|
|
|
|
{
|
2015-04-06 18:41:07 +00:00
|
|
|
auto newSocket = std::make_shared<boost::asio::ip::tcp::socket> (GetService ());
|
2017-08-03 01:00:04 +00:00
|
|
|
m_Acceptor->async_accept (*newSocket, std::bind (&TCPIPAcceptor::HandleAccept, this,
|
2015-01-08 00:31:31 +00:00
|
|
|
std::placeholders::_1, newSocket));
|
|
|
|
}
|
|
|
|
|
2015-04-06 18:41:07 +00:00
|
|
|
void TCPIPAcceptor::HandleAccept (const boost::system::error_code& ecode, std::shared_ptr<boost::asio::ip::tcp::socket> socket)
|
2015-01-08 00:31:31 +00:00
|
|
|
{
|
|
|
|
if (!ecode)
|
|
|
|
{
|
2016-02-11 00:00:00 +00:00
|
|
|
LogPrint(eLogDebug, "I2PService: ", GetName(), " accepted");
|
2015-01-08 00:31:31 +00:00
|
|
|
auto handler = CreateHandler(socket);
|
2017-08-31 16:08:22 +00:00
|
|
|
if (handler)
|
2015-04-06 18:41:07 +00:00
|
|
|
{
|
2015-01-08 00:31:31 +00:00
|
|
|
AddHandler(handler);
|
|
|
|
handler->Handle();
|
2017-08-31 16:08:22 +00:00
|
|
|
}
|
|
|
|
else
|
2015-01-08 00:31:31 +00:00
|
|
|
socket->close();
|
|
|
|
Accept();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (ecode != boost::asio::error::operation_aborted)
|
2016-02-11 00:00:00 +00:00
|
|
|
LogPrint (eLogError, "I2PService: ", GetName(), " closing socket on accept because: ", ecode.message ());
|
2015-01-08 00:31:31 +00:00
|
|
|
}
|
|
|
|
}
|
2015-01-07 18:09:59 +00:00
|
|
|
}
|
|
|
|
}
|