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

Method ProcessGarlicMessage

libi2pd/Destination.cpp:313–333  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

311 }
312
313 void LeaseSetDestination::ProcessGarlicMessage (std::shared_ptr<I2NPMessage> msg)
314 {
315 if (!msg) return;
316 bool empty = false;
317 {
318 std::lock_guard<std::mutex> l(m_IncomingMsgsQueueMutex);
319 empty = m_IncomingMsgsQueue.empty ();
320 m_IncomingMsgsQueue.push_back (msg);
321 }
322 if (empty)
323 boost::asio::post (m_Service, [s = shared_from_this ()]()
324 {
325 std::list<std::shared_ptr<I2NPMessage> > receivedMsgs;
326 {
327 std::lock_guard<std::mutex> l(s->m_IncomingMsgsQueueMutex);
328 s->m_IncomingMsgsQueue.swap (receivedMsgs);
329 }
330 for (auto& it: receivedMsgs)
331 s->HandleGarlicMessage (it);
332 });
333 }
334
335 void LeaseSetDestination::ProcessDeliveryStatusMessage (std::shared_ptr<I2NPMessage> msg)
336 {

Callers

nothing calls this directly

Calls 2

push_backMethod · 0.80
HandleGarlicMessageMethod · 0.80

Tested by

no test coverage detected