Browse Source

don't process packet in terminated stream

pull/2018/head
orignal 9 months ago
parent
commit
7e3157b162
  1. 7
      libi2pd/Streaming.cpp

7
libi2pd/Streaming.cpp

@ -129,6 +129,11 @@ namespace stream @@ -129,6 +129,11 @@ namespace stream
void Stream::HandleNextPacket (Packet * packet)
{
if (m_Status == eStreamStatusTerminated)
{
m_LocalDestination.DeletePacket (packet);
return;
}
m_NumReceivedBytes += packet->GetLength ();
if (!m_SendStreamID)
{
@ -159,6 +164,7 @@ namespace stream @@ -159,6 +164,7 @@ namespace stream
{
// we have received next in sequence message
ProcessPacket (packet);
if (m_Status == eStreamStatusTerminated) return;
// we should also try stored messages if any
for (auto it = m_SavedPackets.begin (); it != m_SavedPackets.end ();)
@ -169,6 +175,7 @@ namespace stream @@ -169,6 +175,7 @@ namespace stream
m_SavedPackets.erase (it++);
ProcessPacket (savedPacket);
if (m_Status == eStreamStatusTerminated) return;
}
else
break;

Loading…
Cancel
Save