| 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 | { |
nothing calls this directly
no test coverage detected