mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-13 01:20:22 +03:00
make sure remote endpoint matches stored with
This commit is contained in:
parent
16a14c2b76
commit
1bfb9b02f5
@ -750,6 +750,11 @@ namespace transport
|
|||||||
if (it.second->IsTerminationTimeoutExpired (ts))
|
if (it.second->IsTerminationTimeoutExpired (ts))
|
||||||
{
|
{
|
||||||
auto session = it.second;
|
auto session = it.second;
|
||||||
|
if (it.first != session->GetRemoteEndpoint ())
|
||||||
|
{
|
||||||
|
LogPrint (eLogWarning, "SSU: remote endpoint ", session->GetRemoteEndpoint (), " doesn't match key ", it.first, " adjusted");
|
||||||
|
session->SetRemoteEndpoint (it.first); // TODO: investigate why it happens
|
||||||
|
}
|
||||||
m_Service.post ([session]
|
m_Service.post ([session]
|
||||||
{
|
{
|
||||||
LogPrint (eLogWarning, "SSU: no activity with ", session->GetRemoteEndpoint (), " for ", session->GetTerminationTimeout (), " seconds");
|
LogPrint (eLogWarning, "SSU: no activity with ", session->GetRemoteEndpoint (), " for ", session->GetTerminationTimeout (), " seconds");
|
||||||
@ -776,6 +781,11 @@ namespace transport
|
|||||||
if (it.second->IsTerminationTimeoutExpired (ts))
|
if (it.second->IsTerminationTimeoutExpired (ts))
|
||||||
{
|
{
|
||||||
auto session = it.second;
|
auto session = it.second;
|
||||||
|
if (it.first != session->GetRemoteEndpoint ())
|
||||||
|
{
|
||||||
|
LogPrint (eLogWarning, "SSU: remote endpoint ", session->GetRemoteEndpoint (), " doesn't match key ", it.first, " adjusted");
|
||||||
|
session->SetRemoteEndpoint (it.first); // TODO: investigate why it happens
|
||||||
|
}
|
||||||
m_ServiceV6.post ([session]
|
m_ServiceV6.post ([session]
|
||||||
{
|
{
|
||||||
LogPrint (eLogWarning, "SSU: no activity with ", session->GetRemoteEndpoint (), " for ", session->GetTerminationTimeout (), " seconds");
|
LogPrint (eLogWarning, "SSU: no activity with ", session->GetRemoteEndpoint (), " for ", session->GetTerminationTimeout (), " seconds");
|
||||||
|
@ -81,6 +81,7 @@ namespace transport
|
|||||||
void Done ();
|
void Done ();
|
||||||
void Failed ();
|
void Failed ();
|
||||||
boost::asio::ip::udp::endpoint& GetRemoteEndpoint () { return m_RemoteEndpoint; };
|
boost::asio::ip::udp::endpoint& GetRemoteEndpoint () { return m_RemoteEndpoint; };
|
||||||
|
void SetRemoteEndpoint (const boost::asio::ip::udp::endpoint& ep) { m_RemoteEndpoint = ep; }; // TODO: not to use
|
||||||
bool IsV6 () const { return m_RemoteEndpoint.address ().is_v6 (); };
|
bool IsV6 () const { return m_RemoteEndpoint.address ().is_v6 (); };
|
||||||
void SendI2NPMessages (const std::vector<std::shared_ptr<I2NPMessage> >& msgs);
|
void SendI2NPMessages (const std::vector<std::shared_ptr<I2NPMessage> >& msgs);
|
||||||
void SendPeerTest (); // Alice
|
void SendPeerTest (); // Alice
|
||||||
|
Loading…
Reference in New Issue
Block a user