summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-01 15:07:27 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-01 15:07:27 +0000
commit6278262baaed06e2acf134c53ed0485136d61f50 (patch)
tree4cf7a6f83e0a95ea6e8ef8356422595731af46ee
parentb796d975cfc6212fe689bda35440d60e2219e03d (diff)
Rename User::GetPort to GetServerPort to clarify its purpose
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11577 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--include/users.h2
-rw-r--r--src/commands/cmd_who.cpp2
-rw-r--r--src/modules/extra/m_ssl_gnutls.cpp4
-rw-r--r--src/modules/extra/m_ssl_openssl.cpp2
-rw-r--r--src/modules/m_cgiirc.cpp6
-rw-r--r--src/modules/m_check.cpp2
-rw-r--r--src/modules/m_close.cpp2
-rw-r--r--src/modules/m_hostchange.cpp2
-rw-r--r--src/modules/m_httpd_stats.cpp2
-rw-r--r--src/users.cpp9
10 files changed, 17 insertions, 16 deletions
diff --git a/include/users.h b/include/users.h
index 0964de9b9..e681ef326 100644
--- a/include/users.h
+++ b/include/users.h
@@ -486,7 +486,7 @@ class CoreExport User : public EventHandler
/** Get port number from sockaddr
* @return The port number of this user.
*/
- int GetPort();
+ int GetServerPort();
/** Get IP string from sockaddr, using static internal buffer
* @return The IP string
diff --git a/src/commands/cmd_who.cpp b/src/commands/cmd_who.cpp
index 718eb2002..9e14ecb45 100644
--- a/src/commands/cmd_who.cpp
+++ b/src/commands/cmd_who.cpp
@@ -81,7 +81,7 @@ bool CommandWho::whomatch(User* user, const char* matchtext)
irc::portparser portrange(matchtext, false);
long portno = -1;
while ((portno = portrange.GetToken()))
- if (portno == user->GetPort())
+ if (portno == user->GetServerPort())
{
match = true;
break;
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp
index af073b811..2fa060360 100644
--- a/src/modules/extra/m_ssl_gnutls.cpp
+++ b/src/modules/extra/m_ssl_gnutls.cpp
@@ -81,7 +81,7 @@ class CommandStartTLS : public Command
{
user->WriteNumeric(670, "%s :STARTTLS successful, go ahead with TLS handshake", user->nick.c_str());
user->AddIOHook(Caller);
- Caller->OnRawSocketAccept(user->GetFd(), user->GetIPString(), user->GetPort());
+ Caller->OnRawSocketAccept(user->GetFd(), user->GetIPString(), user->GetServerPort());
}
else
user->WriteNumeric(691, "%s :STARTTLS failure", user->nick.c_str());
@@ -349,7 +349,7 @@ class ModuleSSLGnuTLS : public Module
virtual void OnHookUserIO(User* user, const std::string &targetip)
{
- if (!user->GetIOHook() && isin(targetip,user->GetPort(),listenports))
+ if (!user->GetIOHook() && isin(targetip,user->GetServerPort(),listenports))
{
/* Hook the user with our module */
user->AddIOHook(this);
diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp
index b38b5c96f..0259c105a 100644
--- a/src/modules/extra/m_ssl_openssl.cpp
+++ b/src/modules/extra/m_ssl_openssl.cpp
@@ -159,7 +159,7 @@ class ModuleSSLOpenSSL : public Module
virtual void OnHookUserIO(User* user, const std::string &targetip)
{
- if (!user->GetIOHook() && isin(targetip,user->GetPort(), listenports))
+ if (!user->GetIOHook() && isin(targetip,user->GetServerPort(), listenports))
{
/* Hook the user with our module */
user->AddIOHook(this);
diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp
index 048f8bde0..85acae8ab 100644
--- a/src/modules/m_cgiirc.cpp
+++ b/src/modules/m_cgiirc.cpp
@@ -117,7 +117,7 @@ class CGIResolver : public Resolver
them->host.assign(result,0, 64);
them->dhost.assign(result, 0, 64);
if (querytype)
- them->SetSockAddr(result.c_str(), them->GetPort());
+ them->SetSockAddr(result.c_str(), them->GetServerPort());
them->ident.assign("~cgiirc", 0, 8);
them->InvalidateCache();
them->CheckLines(true);
@@ -318,7 +318,7 @@ public:
if(user->GetExt("cgiirc_webirc_ip", webirc_ip))
{
ServerInstance->Users->RemoveCloneCounts(user);
- user->SetSockAddr(webirc_ip->c_str(), user->GetPort());
+ user->SetSockAddr(webirc_ip->c_str(), user->GetServerPort());
delete webirc_ip;
user->InvalidateCache();
user->Shrink("cgiirc_webirc_ip");
@@ -407,7 +407,7 @@ public:
user->Extend("cgiirc_realhost", new std::string(user->host));
user->Extend("cgiirc_realip", new std::string(user->GetIPString()));
ServerInstance->Users->RemoveCloneCounts(user);
- user->SetSockAddr(newip, user->GetPort());
+ user->SetSockAddr(newip, user->GetServerPort());
ServerInstance->Users->AddLocalClone(user);
ServerInstance->Users->AddGlobalClone(user);
user->CheckClass();
diff --git a/src/modules/m_check.cpp b/src/modules/m_check.cpp
index acde4ad30..4172e19a3 100644
--- a/src/modules/m_check.cpp
+++ b/src/modules/m_check.cpp
@@ -88,7 +88,7 @@ class CommandCheck : public Command
user->WriteServ(checkstr + " onip " + targuser->GetIPString());
if (IS_LOCAL(targuser))
{
- user->WriteServ(checkstr + " onport " + ConvToStr(targuser->GetPort()));
+ user->WriteServ(checkstr + " onport " + ConvToStr(targuser->GetServerPort()));
std::string classname = targuser->GetClass()->name;
if (!classname.empty())
user->WriteServ(checkstr + " connectclass " + classname);
diff --git a/src/modules/m_close.cpp b/src/modules/m_close.cpp
index 1746508df..8c8fa92f5 100644
--- a/src/modules/m_close.cpp
+++ b/src/modules/m_close.cpp
@@ -43,7 +43,7 @@ class CommandClose : public Command
if ((*u)->registered != REG_ALL)
{
ServerInstance->Users->QuitUser(*u, "Closing all unknown connections per request");
- std::string key = ConvToStr((*u)->GetIPString())+"."+ConvToStr((*u)->GetPort());
+ std::string key = ConvToStr((*u)->GetIPString())+"."+ConvToStr((*u)->GetServerPort());
closed[key]++;
}
}
diff --git a/src/modules/m_hostchange.cpp b/src/modules/m_hostchange.cpp
index b681a4648..a35b2fd5d 100644
--- a/src/modules/m_hostchange.cpp
+++ b/src/modules/m_hostchange.cpp
@@ -107,7 +107,7 @@ class ModuleHostChange : public Module
bool foundany = false;
while ((portno = portrange.GetToken()))
- if (portno == user->GetPort())
+ if (portno == user->GetServerPort())
foundany = true;
if (!foundany)
diff --git a/src/modules/m_httpd_stats.cpp b/src/modules/m_httpd_stats.cpp
index 6c8e7909f..d31807f59 100644
--- a/src/modules/m_httpd_stats.cpp
+++ b/src/modules/m_httpd_stats.cpp
@@ -149,7 +149,7 @@ class ModuleHttpStats : public Module
if (u->IsModeSet(n))
modes += n;
- data << modes << "</modes><ident>" << Sanitize(u->ident) << "</ident><port>" << u->GetPort() << "</port><ipaddress>" << u->GetIPString() << "</ipaddress>";
+ data << modes << "</modes><ident>" << Sanitize(u->ident) << "</ident><port>" << u->GetServerPort() << "</port><ipaddress>" << u->GetIPString() << "</ipaddress>";
data << "</user>";
}
diff --git a/src/users.cpp b/src/users.cpp
index 44dd9b0f2..7c752165c 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -988,7 +988,8 @@ void User::FullConnect()
FOREACH_MOD(I_OnPostConnect,OnPostConnect(this));
- ServerInstance->SNO->WriteToSnoMask('c',"Client connecting on port %d: %s!%s@%s [%s] [%s]", this->GetPort(), this->nick.c_str(), this->ident.c_str(), this->host.c_str(), this->GetIPString(), this->fullname.c_str());
+ ServerInstance->SNO->WriteToSnoMask('c',"Client connecting on port %d: %s!%s@%s [%s] [%s]",
+ this->GetServerPort(), this->nick.c_str(), this->ident.c_str(), this->host.c_str(), this->GetIPString(), this->fullname.c_str());
ServerInstance->Logs->Log("BANCACHE", DEBUG, "BanCache: Adding NEGATIVE hit for %s", this->GetIPString());
ServerInstance->BanCache->AddHit(this->GetIPString(), "", "");
}
@@ -1081,7 +1082,7 @@ void User::SetSockAddr(const char* sip, int port)
}
}
-int User::GetPort()
+int User::GetServerPort()
{
switch (this->ip.sa.sa_family)
{
@@ -1817,9 +1818,9 @@ ConnectClass* User::SetClass(const std::string &explicit_name)
ServerInstance->Logs->Log("CONNECTCLASS", DEBUG, "Requires port (%d)", c->GetPort());
/* and our port doesn't match, fail. */
- if (this->GetPort() != c->GetPort())
+ if (this->GetServerPort() != c->GetPort())
{
- ServerInstance->Logs->Log("CONNECTCLASS", DEBUG, "Port match failed (%d)", this->GetPort());
+ ServerInstance->Logs->Log("CONNECTCLASS", DEBUG, "Port match failed (%d)", this->GetServerPort());
continue;
}
}