|
|
|
@ -33,7 +33,6 @@ namespace transport
@@ -33,7 +33,6 @@ namespace transport
|
|
|
|
|
|
|
|
|
|
SSUData::SSUData (SSUSession& session): |
|
|
|
|
m_Session (session), m_ResendTimer (session.GetService ()), |
|
|
|
|
m_IncompleteMessagesCleanupTimer (session.GetService ()), |
|
|
|
|
m_MaxPacketSize (session.IsV6 () ? SSU_V6_MAX_PACKET_SIZE : SSU_V4_MAX_PACKET_SIZE), |
|
|
|
|
m_PacketSize (m_MaxPacketSize), m_LastMessageReceivedTime (0) |
|
|
|
|
{ |
|
|
|
@ -45,13 +44,11 @@ namespace transport
@@ -45,13 +44,11 @@ namespace transport
|
|
|
|
|
|
|
|
|
|
void SSUData::Start () |
|
|
|
|
{ |
|
|
|
|
ScheduleIncompleteMessagesCleanup (); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void SSUData::Stop () |
|
|
|
|
{ |
|
|
|
|
m_ResendTimer.cancel (); |
|
|
|
|
m_IncompleteMessagesCleanupTimer.cancel (); |
|
|
|
|
m_IncompleteMessages.clear (); |
|
|
|
|
m_SentMessages.clear (); |
|
|
|
|
m_ReceivedMessages.clear (); |
|
|
|
@ -487,18 +484,7 @@ namespace transport
@@ -487,18 +484,7 @@ namespace transport
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void SSUData::ScheduleIncompleteMessagesCleanup () |
|
|
|
|
{ |
|
|
|
|
m_IncompleteMessagesCleanupTimer.cancel (); |
|
|
|
|
m_IncompleteMessagesCleanupTimer.expires_from_now (boost::posix_time::seconds(INCOMPLETE_MESSAGES_CLEANUP_TIMEOUT)); |
|
|
|
|
auto s = m_Session.shared_from_this(); |
|
|
|
|
m_IncompleteMessagesCleanupTimer.async_wait ([s](const boost::system::error_code& ecode) |
|
|
|
|
{ s->m_Data.HandleIncompleteMessagesCleanupTimer (ecode); }); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void SSUData::HandleIncompleteMessagesCleanupTimer (const boost::system::error_code& ecode) |
|
|
|
|
{ |
|
|
|
|
if (ecode != boost::asio::error::operation_aborted) |
|
|
|
|
void SSUData::CleanUp () |
|
|
|
|
{ |
|
|
|
|
uint32_t ts = i2p::util::GetSecondsSinceEpoch (); |
|
|
|
|
for (auto it = m_IncompleteMessages.begin (); it != m_IncompleteMessages.end ();) |
|
|
|
@ -526,9 +512,6 @@ namespace transport
@@ -526,9 +512,6 @@ namespace transport
|
|
|
|
|
++it; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ScheduleIncompleteMessagesCleanup (); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|