summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2017-10-27 19:15:23 +0100
committerPeter Powell <petpow@saberuk.com>2017-10-27 19:15:23 +0100
commit08f6f056667df63d1673bea959c73b75393113c6 (patch)
treef051b9cc25c7eea86183560118dde0b777c6dd9a /src
parent998967b58afb411c70dbf772758d4e1a1c7bea7e (diff)
Change SetClientIP to take a C++ string instead of a char array.
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_cgiirc.cpp2
-rw-r--r--src/modules/m_spanningtree/uid.cpp2
-rw-r--r--src/users.cpp8
3 files changed, 6 insertions, 6 deletions
diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp
index 8abf7eb94..21098d7a7 100644
--- a/src/modules/m_cgiirc.cpp
+++ b/src/modules/m_cgiirc.cpp
@@ -36,7 +36,7 @@ enum
static void ChangeIP(User* user, const std::string& newip)
{
ServerInstance->Users->RemoveCloneCounts(user);
- user->SetClientIP(newip.c_str());
+ user->SetClientIP(newip);
ServerInstance->Users->AddClone(user);
}
diff --git a/src/modules/m_spanningtree/uid.cpp b/src/modules/m_spanningtree/uid.cpp
index 91c9f3ca8..2a17943e9 100644
--- a/src/modules/m_spanningtree/uid.cpp
+++ b/src/modules/m_spanningtree/uid.cpp
@@ -115,7 +115,7 @@ CmdResult CommandUID::HandleServer(TreeServer* remoteserver, std::vector<std::st
_new->SetMode(mh, true);
}
- _new->SetClientIP(params[6].c_str());
+ _new->SetClientIP(params[6]);
ServerInstance->Users->AddClone(_new);
remoteserver->UserCount++;
diff --git a/src/users.cpp b/src/users.cpp
index 5aede9312..9fef906d1 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -707,10 +707,10 @@ irc::sockets::cidr_mask User::GetCIDRMask()
return irc::sockets::cidr_mask(client_sa, range);
}
-bool User::SetClientIP(const char* sip, bool recheck_eline)
+bool User::SetClientIP(const std::string& address, bool recheck_eline)
{
this->InvalidateCache();
- return irc::sockets::aptosa(sip, 0, client_sa);
+ return irc::sockets::aptosa(address, 0, client_sa);
}
void User::SetClientIP(const irc::sockets::sockaddrs& sa, bool recheck_eline)
@@ -720,10 +720,10 @@ void User::SetClientIP(const irc::sockets::sockaddrs& sa, bool recheck_eline)
memcpy(&client_sa, &sa, sizeof(irc::sockets::sockaddrs));
}
-bool LocalUser::SetClientIP(const char* sip, bool recheck_eline)
+bool LocalUser::SetClientIP(const std::string& address, bool recheck_eline)
{
irc::sockets::sockaddrs sa;
- if (!irc::sockets::aptosa(sip, 0, sa))
+ if (!irc::sockets::aptosa(address, 0, sa))
// Invalid
return false;