MCPcopy Create free account
hub / github.com/PurpleI2P/i2pd / MoveSendQueue

Method MoveSendQueue

libi2pd/NTCP2.cpp:1551–1564  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1549 }
1550
1551 void NTCP2Session::MoveSendQueue (std::shared_ptr<NTCP2Session> other)
1552 {
1553 if (!other || m_SendQueue.empty ()) return;
1554 std::list<std::shared_ptr<I2NPMessage> > msgs;
1555 auto ts = i2p::util::GetMillisecondsSinceEpoch ();
1556 for (auto it: m_SendQueue)
1557 if (!it->IsExpired (ts))
1558 msgs.push_back (it);
1559 else
1560 it->Drop ();
1561 m_SendQueue.clear ();
1562 if (!msgs.empty ())
1563 other->SendI2NPMessages (msgs);
1564 }
1565
1566 size_t NTCP2Session::CreatePaddingBlock (size_t msgLen, uint8_t * buf, size_t len)
1567 {

Callers 2

AddNTCP2SessionMethod · 0.45

Calls 5

push_backMethod · 0.80
DropMethod · 0.80
IsExpiredMethod · 0.45
SendI2NPMessagesMethod · 0.45

Tested by

no test coverage detected