From 4c904905f5f0667786d4c4b32d150b3d4328cfc2 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Fri, 4 Apr 2025 11:53:03 +0800 Subject: session: use std::string for m_ip instead of c char --- src/session.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/session.hpp') diff --git a/src/session.hpp b/src/session.hpp index 8aee414..65bef68 100644 --- a/src/session.hpp +++ b/src/session.hpp @@ -23,7 +23,7 @@ class CSession { }; const std::string &getName() const; - const char *getIp() const; + const std::string &getIp() const; void setSelf(std::pair> *self); std::unique_ptr read(); @@ -57,7 +57,7 @@ class CSession { sockaddr_in m_addr; socklen_t m_addrLen = sizeof(m_addr); std::string m_name; - char m_ip[INET_ADDRSTRLEN]; + std::string m_ip; int m_port; bool m_isAdmin = false; -- cgit v1.2.3