From b97f09cc9594959164ff97e59f9064a396f12db6 Mon Sep 17 00:00:00 2001 From: orignal Date: Wed, 19 Feb 2025 18:51:54 -0500 Subject: [PATCH] const ExtractString and ExtractMapping --- libi2pd_client/I2CP.cpp | 4 ++-- libi2pd_client/I2CP.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libi2pd_client/I2CP.cpp b/libi2pd_client/I2CP.cpp index f6494a51..df93082b 100644 --- a/libi2pd_client/I2CP.cpp +++ b/libi2pd_client/I2CP.cpp @@ -571,7 +571,7 @@ namespace client m_IsSending = false; } - std::string_view I2CPSession::ExtractString (const uint8_t * buf, size_t len) + std::string_view I2CPSession::ExtractString (const uint8_t * buf, size_t len) const { uint8_t l = buf[0]; if (l > len) l = len; @@ -588,7 +588,7 @@ namespace client return l + 1; } - void I2CPSession::ExtractMapping (const uint8_t * buf, size_t len, std::map& mapping) + void I2CPSession::ExtractMapping (const uint8_t * buf, size_t len, std::map& mapping) const // TODO: move to Base.cpp { size_t offset = 0; diff --git a/libi2pd_client/I2CP.h b/libi2pd_client/I2CP.h index 50b668d3..d3949eaa 100644 --- a/libi2pd_client/I2CP.h +++ b/libi2pd_client/I2CP.h @@ -194,9 +194,9 @@ namespace client void HandleI2CPMessageSent (const boost::system::error_code& ecode, std::size_t bytes_transferred); - std::string_view ExtractString (const uint8_t * buf, size_t len); + std::string_view ExtractString (const uint8_t * buf, size_t len) const; size_t PutString (uint8_t * buf, size_t len, std::string_view str); - void ExtractMapping (const uint8_t * buf, size_t len, std::map& mapping); + void ExtractMapping (const uint8_t * buf, size_t len, std::map& mapping) const; void SendSessionStatusMessage (I2CPSessionStatus status); void SendHostReplyMessage (uint32_t requestID, std::shared_ptr identity);