Compare commits

..

2 Commits

Author SHA1 Message Date
lcharles123
67fc4cd26b Merge 6e639f0e6a into 72ff0b9fbb 2025-01-26 02:29:27 +03:00
orignal
72ff0b9fbb shorter ack request interval 2025-01-25 09:02:18 -05:00
2 changed files with 8 additions and 6 deletions

View File

@@ -764,6 +764,7 @@ namespace client
void I2CPSession::AddRoutingSession (const i2p::data::IdentHash& signingKey, std::shared_ptr<i2p::garlic::GarlicRoutingSession> remoteSession)
{
if (!remoteSession) return;
remoteSession->SetAckRequestInterval (I2CP_SESSION_ACK_REQUEST_INTERVAL);
std::lock_guard<std::mutex> l(m_RoutingSessionsMutex);
m_RoutingSessions[signingKey] = remoteSession;
}
@@ -1110,12 +1111,12 @@ namespace client
void I2CPServer::Stop ()
{
m_Acceptor.cancel ();
{
auto sessions = m_Sessions;
for (auto& it: sessions)
it.second->Stop ();
}
m_Sessions.clear ();
decltype(m_Sessions) sessions;
m_Sessions.swap (sessions);
for (auto& it: sessions)
it.second->Stop ();
StopIOService ();
}

View File

@@ -31,6 +31,7 @@ namespace client
const size_t I2CP_MAX_MESSAGE_LENGTH = 65535;
const size_t I2CP_MAX_SEND_QUEUE_SIZE = 1024*1024; // in bytes, 1M
const int I2CP_LEASESET_CREATION_TIMEOUT = 10; // in seconds
const int I2CP_SESSION_ACK_REQUEST_INTERVAL = 12100; // in milliseconds
const size_t I2CP_HEADER_LENGTH_OFFSET = 0;
const size_t I2CP_HEADER_TYPE_OFFSET = I2CP_HEADER_LENGTH_OFFSET + 4;