http: Introduce HTTPRemoteClient class
What changed, and why it matters
This commit only adds a new C++ class definition to a header file. It does not change any existing behavior, fix a bug, or alter how the program handles data. There is nothing here that would allow an attacker to exploit the software.
No security action needed; this is a benign structural/refactoring change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch introduces HTTPRemoteClient, a simple immutable data holder for an HTTP connection’s server-assigned ID, remote CService address, and a cached string representation of that address. It is declared in src/httpserver.h with deleted copy constructor/assignment. No methods consume or produce sensitive state, and no existing code paths are modified.
Changed components
src/httpserver.hInspect captured patch +20 / −0
diff --git a/src/httpserver.h b/src/httpserver.h
index 20b9731c..5b7922df 100644
--- a/src/httpserver.h
+++ b/src/httpserver.h
@@ -363,6 +363,26 @@ private:
*/
Id GetNewId();
};
+
+class HTTPRemoteClient
+{
+public:
+ //! ID provided by HTTPServer upon connection and instantiation
+ const HTTPServer::Id m_id;
+
+ //! Remote address of connected client
+ const CService m_addr;
+
+ //! IP:port of connected client, cached for logging purposes
+ const std::string m_origin;
+
+ explicit HTTPRemoteClient(HTTPServer::Id id, const CService& addr)
+ : m_id(id), m_addr(addr), m_origin(addr.ToStringAddrPort()) {};
+
+ // Disable copies (should only be used as shared pointers)
+ HTTPRemoteClient(const HTTPRemoteClient&) = delete;
+ HTTPRemoteClient& operator=(const HTTPRemoteClient&) = delete;
+};
} // namespace http_bitcoin
#endif // BITCOIN_HTTPSERVER_H
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.