From 6bacf94a62874e051f82fd7b99edd3fb8873bf7f Mon Sep 17 00:00:00 2001 From: orignal Date: Tue, 15 Nov 2016 14:11:55 -0500 Subject: [PATCH] handle all loopback messages --- Transports.cpp | 3 ++- Transports.h | 14 ++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Transports.cpp b/Transports.cpp index d41253d6..d06d8670 100644 --- a/Transports.cpp +++ b/Transports.cpp @@ -260,7 +260,8 @@ namespace transport { // we send it to ourself for (auto& it: msgs) - i2p::HandleI2NPMessage (it); + m_LoopbackHandler.PutNextMessage (it); + m_LoopbackHandler.Flush (); return; } if(RoutesRestricted() && ! IsRestrictedPeer(ident)) return; diff --git a/Transports.h b/Transports.h index 1fe262a9..d83c0370 100644 --- a/Transports.h +++ b/Transports.h @@ -160,13 +160,15 @@ namespace transport uint64_t m_LastInBandwidthUpdateBytes, m_LastOutBandwidthUpdateBytes; uint64_t m_LastBandwidthUpdateTime; - /** which router families to trust for first hops */ - std::vector m_TrustedFamilies; - mutable std::mutex m_FamilyMutex; + /** which router families to trust for first hops */ + std::vector m_TrustedFamilies; + mutable std::mutex m_FamilyMutex; - /** which routers for first hop to trust */ - std::vector m_TrustedRouters; - mutable std::mutex m_TrustedRoutersMutex; + /** which routers for first hop to trust */ + std::vector m_TrustedRouters; + mutable std::mutex m_TrustedRoutersMutex; + + i2p::I2NPMessagesHandler m_LoopbackHandler; public: