mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-19 01:09:58 +00:00
don't process packet in terminated stream
This commit is contained in:
parent
2b6a95cbee
commit
7e3157b162
@ -129,6 +129,11 @@ namespace stream
|
|||||||
|
|
||||||
void Stream::HandleNextPacket (Packet * packet)
|
void Stream::HandleNextPacket (Packet * packet)
|
||||||
{
|
{
|
||||||
|
if (m_Status == eStreamStatusTerminated)
|
||||||
|
{
|
||||||
|
m_LocalDestination.DeletePacket (packet);
|
||||||
|
return;
|
||||||
|
}
|
||||||
m_NumReceivedBytes += packet->GetLength ();
|
m_NumReceivedBytes += packet->GetLength ();
|
||||||
if (!m_SendStreamID)
|
if (!m_SendStreamID)
|
||||||
{
|
{
|
||||||
@ -159,7 +164,8 @@ namespace stream
|
|||||||
{
|
{
|
||||||
// we have received next in sequence message
|
// we have received next in sequence message
|
||||||
ProcessPacket (packet);
|
ProcessPacket (packet);
|
||||||
|
if (m_Status == eStreamStatusTerminated) return;
|
||||||
|
|
||||||
// we should also try stored messages if any
|
// we should also try stored messages if any
|
||||||
for (auto it = m_SavedPackets.begin (); it != m_SavedPackets.end ();)
|
for (auto it = m_SavedPackets.begin (); it != m_SavedPackets.end ();)
|
||||||
{
|
{
|
||||||
@ -169,6 +175,7 @@ namespace stream
|
|||||||
m_SavedPackets.erase (it++);
|
m_SavedPackets.erase (it++);
|
||||||
|
|
||||||
ProcessPacket (savedPacket);
|
ProcessPacket (savedPacket);
|
||||||
|
if (m_Status == eStreamStatusTerminated) return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user