mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-07 06:09:42 +00:00
Compare commits
3 Commits
82ef1c37bc
...
53e6ae5097
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
53e6ae5097 | ||
|
|
72ff0b9fbb | ||
|
|
32a70562c4 |
@@ -122,7 +122,7 @@ namespace transport
|
|||||||
err = UPNP_GetValidIGD (m_Devlist, &m_upnpUrls, &m_upnpData, m_NetworkAddr, sizeof (m_NetworkAddr));
|
err = UPNP_GetValidIGD (m_Devlist, &m_upnpUrls, &m_upnpData, m_NetworkAddr, sizeof (m_NetworkAddr));
|
||||||
#endif
|
#endif
|
||||||
m_upnpUrlsInitialized=err!=0;
|
m_upnpUrlsInitialized=err!=0;
|
||||||
if (err == UPNP_IGD_VALID_CONNECTED)
|
if (err == UPNP_IGD_VALID_CONNECTED || err == UPNP_IGD_VALID_NOT_CONNECTED)
|
||||||
{
|
{
|
||||||
#if (MINIUPNPC_API_VERSION < 18)
|
#if (MINIUPNPC_API_VERSION < 18)
|
||||||
err = UPNP_GetExternalIPAddress (m_upnpUrls.controlURL, m_upnpData.first.servicetype, m_externalIPAddress);
|
err = UPNP_GetExternalIPAddress (m_upnpUrls.controlURL, m_upnpData.first.servicetype, m_externalIPAddress);
|
||||||
|
|||||||
@@ -764,6 +764,7 @@ namespace client
|
|||||||
void I2CPSession::AddRoutingSession (const i2p::data::IdentHash& signingKey, std::shared_ptr<i2p::garlic::GarlicRoutingSession> remoteSession)
|
void I2CPSession::AddRoutingSession (const i2p::data::IdentHash& signingKey, std::shared_ptr<i2p::garlic::GarlicRoutingSession> remoteSession)
|
||||||
{
|
{
|
||||||
if (!remoteSession) return;
|
if (!remoteSession) return;
|
||||||
|
remoteSession->SetAckRequestInterval (I2CP_SESSION_ACK_REQUEST_INTERVAL);
|
||||||
std::lock_guard<std::mutex> l(m_RoutingSessionsMutex);
|
std::lock_guard<std::mutex> l(m_RoutingSessionsMutex);
|
||||||
m_RoutingSessions[signingKey] = remoteSession;
|
m_RoutingSessions[signingKey] = remoteSession;
|
||||||
}
|
}
|
||||||
@@ -1110,12 +1111,12 @@ namespace client
|
|||||||
void I2CPServer::Stop ()
|
void I2CPServer::Stop ()
|
||||||
{
|
{
|
||||||
m_Acceptor.cancel ();
|
m_Acceptor.cancel ();
|
||||||
{
|
|
||||||
auto sessions = m_Sessions;
|
decltype(m_Sessions) sessions;
|
||||||
for (auto& it: sessions)
|
m_Sessions.swap (sessions);
|
||||||
it.second->Stop ();
|
for (auto& it: sessions)
|
||||||
}
|
it.second->Stop ();
|
||||||
m_Sessions.clear ();
|
|
||||||
StopIOService ();
|
StopIOService ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ namespace client
|
|||||||
const size_t I2CP_MAX_MESSAGE_LENGTH = 65535;
|
const size_t I2CP_MAX_MESSAGE_LENGTH = 65535;
|
||||||
const size_t I2CP_MAX_SEND_QUEUE_SIZE = 1024*1024; // in bytes, 1M
|
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_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_LENGTH_OFFSET = 0;
|
||||||
const size_t I2CP_HEADER_TYPE_OFFSET = I2CP_HEADER_LENGTH_OFFSET + 4;
|
const size_t I2CP_HEADER_TYPE_OFFSET = I2CP_HEADER_LENGTH_OFFSET + 4;
|
||||||
|
|||||||
Reference in New Issue
Block a user