@@ -1078,7 +1078,8 @@ namespace transport
10781078 {
10791079 if (m_IsPublished)
10801080 {
1081- m_IntroducersUpdateTimer.expires_from_now (boost::posix_time::seconds (SSU2_KEEP_ALIVE_INTERVAL));
1081+ m_IntroducersUpdateTimer.expires_from_now (boost::posix_time::seconds (
1082+ SSU2_KEEP_ALIVE_INTERVAL + rand () % SSU2_KEEP_ALIVE_INTERVAL_VARIANCE));
10821083 m_IntroducersUpdateTimer.async_wait (std::bind (&SSU2Server::HandleIntroducersUpdateTimer,
10831084 this , std::placeholders::_1, true ));
10841085 }
@@ -1091,7 +1092,8 @@ namespace transport
10911092 m_IntroducersUpdateTimer.cancel ();
10921093 i2p::context.ClearSSU2Introducers (true );
10931094 m_Introducers.clear ();
1094- m_IntroducersUpdateTimer.expires_from_now (boost::posix_time::seconds (SSU2_KEEP_ALIVE_INTERVAL/2 ));
1095+ m_IntroducersUpdateTimer.expires_from_now (boost::posix_time::seconds (
1096+ (SSU2_KEEP_ALIVE_INTERVAL + rand () % SSU2_KEEP_ALIVE_INTERVAL_VARIANCE)/2 ));
10951097 m_IntroducersUpdateTimer.async_wait (std::bind (&SSU2Server::HandleIntroducersUpdateTimer,
10961098 this , std::placeholders::_1, true ));
10971099 }
@@ -1101,7 +1103,8 @@ namespace transport
11011103 {
11021104 if (m_IsPublished)
11031105 {
1104- m_IntroducersUpdateTimerV6.expires_from_now (boost::posix_time::seconds (SSU2_KEEP_ALIVE_INTERVAL));
1106+ m_IntroducersUpdateTimerV6.expires_from_now (boost::posix_time::seconds (
1107+ SSU2_KEEP_ALIVE_INTERVAL + rand () % SSU2_KEEP_ALIVE_INTERVAL_VARIANCE));
11051108 m_IntroducersUpdateTimerV6.async_wait (std::bind (&SSU2Server::HandleIntroducersUpdateTimer,
11061109 this , std::placeholders::_1, false ));
11071110 }
@@ -1114,7 +1117,8 @@ namespace transport
11141117 m_IntroducersUpdateTimerV6.cancel ();
11151118 i2p::context.ClearSSU2Introducers (false );
11161119 m_IntroducersV6.clear ();
1117- m_IntroducersUpdateTimerV6.expires_from_now (boost::posix_time::seconds (SSU2_KEEP_ALIVE_INTERVAL/2 ));
1120+ m_IntroducersUpdateTimerV6.expires_from_now (boost::posix_time::seconds (
1121+ (SSU2_KEEP_ALIVE_INTERVAL + rand () % SSU2_KEEP_ALIVE_INTERVAL_VARIANCE)/2 ));
11181122 m_IntroducersUpdateTimerV6.async_wait (std::bind (&SSU2Server::HandleIntroducersUpdateTimer,
11191123 this , std::placeholders::_1, false ));
11201124 }
0 commit comments