const ExtractString and ExtractMapping

This commit is contained in:
orignal 2025-02-19 18:51:54 -05:00
parent aedf59d11a
commit b97f09cc95
2 changed files with 4 additions and 4 deletions
libi2pd_client

View file

@ -571,7 +571,7 @@ namespace client
m_IsSending = false; 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]; uint8_t l = buf[0];
if (l > len) l = len; if (l > len) l = len;
@ -588,7 +588,7 @@ namespace client
return l + 1; return l + 1;
} }
void I2CPSession::ExtractMapping (const uint8_t * buf, size_t len, std::map<std::string, std::string>& mapping) void I2CPSession::ExtractMapping (const uint8_t * buf, size_t len, std::map<std::string, std::string>& mapping) const
// TODO: move to Base.cpp // TODO: move to Base.cpp
{ {
size_t offset = 0; size_t offset = 0;

View file

@ -194,9 +194,9 @@ namespace client
void HandleI2CPMessageSent (const boost::system::error_code& ecode, std::size_t bytes_transferred); 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); size_t PutString (uint8_t * buf, size_t len, std::string_view str);
void ExtractMapping (const uint8_t * buf, size_t len, std::map<std::string, std::string>& mapping); void ExtractMapping (const uint8_t * buf, size_t len, std::map<std::string, std::string>& mapping) const;
void SendSessionStatusMessage (I2CPSessionStatus status); void SendSessionStatusMessage (I2CPSessionStatus status);
void SendHostReplyMessage (uint32_t requestID, std::shared_ptr<const i2p::data::IdentityEx> identity); void SendHostReplyMessage (uint32_t requestID, std::shared_ptr<const i2p::data::IdentityEx> identity);