[api] Remove duplicate peername storage to save RAM (#13540)

This commit is contained in:
J. Nick Koston
2026-02-11 07:23:16 +13:00
committed by GitHub
parent b8ec3aab1d
commit 2585779f11
8 changed files with 65 additions and 26 deletions
+4 -2
View File
@@ -276,8 +276,10 @@ class APIConnection final : public APIServerConnectionBase {
bool send_buffer(ProtoWriteBuffer buffer, uint8_t message_type) override;
const char *get_name() const { return this->helper_->get_client_name(); }
/// Get peer name (IP address) - cached at connection init time
const char *get_peername() const { return this->helper_->get_client_peername(); }
/// Get peer name (IP address) into caller-provided buffer, returns buf for convenience
const char *get_peername_to(std::span<char, socket::SOCKADDR_STR_LEN> buf) const {
return this->helper_->get_peername_to(buf);
}
protected:
// Helper function to handle authentication completion