From 0007f304d00157ac28ecdac2d970641adf79bec9 Mon Sep 17 00:00:00 2001 From: orignal Date: Tue, 7 Jan 2020 15:20:55 -0500 Subject: [PATCH] don't pass from to HandleI2NPMessage --- libi2pd/Destination.cpp | 6 +++--- libi2pd/Destination.h | 2 +- libi2pd/Garlic.cpp | 4 ++-- libi2pd/Garlic.h | 2 +- libi2pd/RouterContext.cpp | 6 +++--- libi2pd/RouterContext.h | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/libi2pd/Destination.cpp b/libi2pd/Destination.cpp index f6855844..c3f63ffc 100644 --- a/libi2pd/Destination.cpp +++ b/libi2pd/Destination.cpp @@ -357,11 +357,10 @@ namespace client m_Service.post (std::bind (&LeaseSetDestination::HandleDeliveryStatusMessage, shared_from_this (), msgID)); } - void LeaseSetDestination::HandleI2NPMessage (const uint8_t * buf, size_t len, std::shared_ptr from) + void LeaseSetDestination::HandleI2NPMessage (const uint8_t * buf, size_t len) { uint8_t typeID = buf[I2NP_HEADER_TYPEID_OFFSET]; - if (!HandleCloveI2NPMessage (typeID, buf + I2NP_HEADER_SIZE, GetI2NPMessageLength(buf, len) - I2NP_HEADER_SIZE)) - i2p::HandleI2NPMessage (CreateI2NPMessage (buf, GetI2NPMessageLength (buf, len), from)); + LeaseSetDestination::HandleCloveI2NPMessage (typeID, buf + I2NP_HEADER_SIZE, GetI2NPMessageLength(buf, len) - I2NP_HEADER_SIZE); } bool LeaseSetDestination::HandleCloveI2NPMessage (uint8_t typeID, const uint8_t * payload, size_t len) @@ -382,6 +381,7 @@ namespace client HandleDatabaseSearchReplyMessage (payload, len); break; default: + LogPrint (eLogWarning, "Destination: Unexpected I2NP message type ", typeID); return false; } return true; diff --git a/libi2pd/Destination.h b/libi2pd/Destination.h index bf08c80c..2b7f7bb8 100644 --- a/libi2pd/Destination.h +++ b/libi2pd/Destination.h @@ -131,7 +131,7 @@ namespace client protected: // implements GarlicDestination - void HandleI2NPMessage (const uint8_t * buf, size_t len, std::shared_ptr from); + void HandleI2NPMessage (const uint8_t * buf, size_t len); bool HandleCloveI2NPMessage (uint8_t typeID, const uint8_t * payload, size_t len); void SetLeaseSet (std::shared_ptr newLeaseSet); diff --git a/libi2pd/Garlic.cpp b/libi2pd/Garlic.cpp index 82778ddc..e87aae05 100644 --- a/libi2pd/Garlic.cpp +++ b/libi2pd/Garlic.cpp @@ -552,7 +552,7 @@ namespace garlic LogPrint (eLogError, "Garlic: message is too short"); break; } - HandleI2NPMessage (buf, len - offset, from); + HandleI2NPMessage (buf, len - offset); break; case eGarlicDeliveryTypeDestination: LogPrint (eLogDebug, "Garlic: type destination"); @@ -563,7 +563,7 @@ namespace garlic LogPrint (eLogError, "Garlic: message is too short"); break; } - HandleI2NPMessage (buf, len - offset, from); + HandleI2NPMessage (buf, len - offset); break; case eGarlicDeliveryTypeTunnel: { diff --git a/libi2pd/Garlic.h b/libi2pd/Garlic.h index 5ef77638..6acfce95 100644 --- a/libi2pd/Garlic.h +++ b/libi2pd/Garlic.h @@ -204,7 +204,7 @@ namespace garlic protected: - virtual void HandleI2NPMessage (const uint8_t * buf, size_t len, std::shared_ptr from) = 0; // called from clove only + virtual void HandleI2NPMessage (const uint8_t * buf, size_t len) = 0; // called from clove only virtual bool HandleCloveI2NPMessage (uint8_t typeID, const uint8_t * payload, size_t len) = 0; void HandleGarlicMessage (std::shared_ptr msg); void HandleDeliveryStatusMessage (uint32_t msgID); diff --git a/libi2pd/RouterContext.cpp b/libi2pd/RouterContext.cpp index bf3459d8..2c07c21b 100644 --- a/libi2pd/RouterContext.cpp +++ b/libi2pd/RouterContext.cpp @@ -27,7 +27,7 @@ namespace i2p void RouterContext::Init () { srand (i2p::util::GetMillisecondsSinceEpoch () % 1000); - m_StartupTime = std::chrono::steady_clock::now(); + m_StartupTime = std::chrono::steady_clock::now(); if (!Load ()) CreateNewRouter (); @@ -692,9 +692,9 @@ namespace i2p return i2p::tunnel::tunnels.GetExploratoryPool (); } - void RouterContext::HandleI2NPMessage (const uint8_t * buf, size_t len, std::shared_ptr from) + void RouterContext::HandleI2NPMessage (const uint8_t * buf, size_t len) { - i2p::HandleI2NPMessage (CreateI2NPMessage (buf, GetI2NPMessageLength (buf, len), from)); + i2p::HandleI2NPMessage (CreateI2NPMessage (buf, GetI2NPMessageLength (buf, len))); } void RouterContext::ProcessGarlicMessage (std::shared_ptr msg) diff --git a/libi2pd/RouterContext.h b/libi2pd/RouterContext.h index 47a6f4fa..1524270d 100644 --- a/libi2pd/RouterContext.h +++ b/libi2pd/RouterContext.h @@ -123,7 +123,7 @@ namespace i2p protected: // implements GarlicDestination - void HandleI2NPMessage (const uint8_t * buf, size_t len, std::shared_ptr from); + void HandleI2NPMessage (const uint8_t * buf, size_t len); bool HandleCloveI2NPMessage (uint8_t typeID, const uint8_t * payload, size_t len) { return false; }; // not implemented private: