summaryrefslogtreecommitdiff
path: root/src/sessionManager.cpp
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2025-04-04 11:53:03 +0800
committerlittleblack111 <littleblack11111@gmail.com>2025-04-07 16:32:07 +0800
commit4c904905f5f0667786d4c4b32d150b3d4328cfc2 (patch)
treea397604070be947ea051f0db3555c34e604686df /src/sessionManager.cpp
parent48c6f2384592c42a0fdbb6e420c77f6e10209f24 (diff)
session: use std::string for m_ip instead of c char
Diffstat (limited to 'src/sessionManager.cpp')
-rw-r--r--src/sessionManager.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sessionManager.cpp b/src/sessionManager.cpp
index 911ec60..b81aeaf 100644
--- a/src/sessionManager.cpp
+++ b/src/sessionManager.cpp
@@ -79,8 +79,8 @@ CSession *CSessionManager::getByName(const std::string &name) const {
return it != m_vSessions.end() ? it->second.get() : nullptr;
}
-CSession *CSessionManager::getByIp(const char m_ip[INET_ADDRSTRLEN]) const {
- auto it = std::ranges::find_if(m_vSessions, [&m_ip](const auto &s) { log(LOG, s.second->m_ip); return strcmp(s.second->m_ip, m_ip) == 0; });
+CSession *CSessionManager::getByIp(const std::string &ip) const {
+ auto it = std::ranges::find_if(m_vSessions, [&ip](const auto &s) { log(LOG, s.second->m_ip); return s.second->m_ip == ip; });
return it != m_vSessions.end() ? it->second.get() : nullptr;
}