Skip to content

Commit

Permalink
shorter ack request interval
Browse files Browse the repository at this point in the history
  • Loading branch information
orignal committed Jan 25, 2025
1 parent b9c9988 commit 72ff0b9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
13 changes: 7 additions & 6 deletions libi2pd_client/I2CP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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 ();
}

Expand Down
1 change: 1 addition & 0 deletions libi2pd_client/I2CP.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 72ff0b9

Please sign in to comment.