Browse Source

reset peding time offset if correct time was received

pull/2003/head
orignal 12 months ago
parent
commit
c5cab05a6b
  1. 7
      libi2pd/SSU2Session.cpp

7
libi2pd/SSU2Session.cpp

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2022-2023, The PurpleI2P Project * Copyright (c) 2022-2024, The PurpleI2P Project
* *
* This file is part of Purple i2pd project and licensed under BSD3 * This file is part of Purple i2pd project and licensed under BSD3
* *
@ -1668,8 +1668,13 @@ namespace transport
if (m_Server.IsSyncClockFromPeers ()) if (m_Server.IsSyncClockFromPeers ())
{ {
if (std::abs (offset) > SSU2_CLOCK_THRESHOLD) if (std::abs (offset) > SSU2_CLOCK_THRESHOLD)
{
LogPrint (eLogWarning, "SSU2: Time offset ", offset, " from ", m_RemoteEndpoint);
m_Server.AdjustTimeOffset (-offset); m_Server.AdjustTimeOffset (-offset);
} }
else
m_Server.AdjustTimeOffset (0);
}
else if (std::abs (offset) > SSU2_CLOCK_SKEW) else if (std::abs (offset) > SSU2_CLOCK_SKEW)
{ {
LogPrint (eLogError, "SSU2: Clock skew detected ", offset, ". Check your clock"); LogPrint (eLogError, "SSU2: Clock skew detected ", offset, ". Check your clock");

Loading…
Cancel
Save