mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-12 17:10:20 +03:00
cleanup messages to send if session was terminated
This commit is contained in:
parent
361f364966
commit
f04048717d
@ -1301,7 +1301,11 @@ namespace transport
|
|||||||
|
|
||||||
void NTCP2Session::SendI2NPMessages (std::list<std::shared_ptr<I2NPMessage> >& msgs)
|
void NTCP2Session::SendI2NPMessages (std::list<std::shared_ptr<I2NPMessage> >& msgs)
|
||||||
{
|
{
|
||||||
if (m_IsTerminated || msgs.empty ()) return;
|
if (m_IsTerminated || msgs.empty ())
|
||||||
|
{
|
||||||
|
msgs.clear ();
|
||||||
|
return;
|
||||||
|
}
|
||||||
bool empty = false;
|
bool empty = false;
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> l(m_IntermediateQueueMutex);
|
std::lock_guard<std::mutex> l(m_IntermediateQueueMutex);
|
||||||
|
@ -376,7 +376,11 @@ namespace transport
|
|||||||
|
|
||||||
void SSU2Session::SendI2NPMessages (std::list<std::shared_ptr<I2NPMessage> >& msgs)
|
void SSU2Session::SendI2NPMessages (std::list<std::shared_ptr<I2NPMessage> >& msgs)
|
||||||
{
|
{
|
||||||
if (m_State == eSSU2SessionStateTerminated || msgs.empty ()) return;
|
if (m_State == eSSU2SessionStateTerminated || msgs.empty ())
|
||||||
|
{
|
||||||
|
msgs.clear ();
|
||||||
|
return;
|
||||||
|
}
|
||||||
bool empty = false;
|
bool empty = false;
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> l(m_IntermediateQueueMutex);
|
std::lock_guard<std::mutex> l(m_IntermediateQueueMutex);
|
||||||
|
Loading…
Reference in New Issue
Block a user