diff options
author | Peter Powell <petpow@saberuk.com> | 2017-08-28 15:13:25 +0100 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2017-09-12 15:05:24 +0100 |
commit | 3b595d39a50e38283768bc6ec8aeb9e73071224f (patch) | |
tree | 06a0e9e38726eaa7ece24bb288f85e318cca70a3 /src | |
parent | 0a623f7a93b92171488d2d11902e42308c2e66c3 (diff) |
Get rid of irc::sockets::satoap().
This function is being misused in all but one scenario. It isn't
really worth keeping IMO.
Diffstat (limited to 'src')
-rw-r--r-- | src/listensocket.cpp | 3 | ||||
-rw-r--r-- | src/modules/m_httpd.cpp | 6 | ||||
-rw-r--r-- | src/socket.cpp | 7 | ||||
-rw-r--r-- | src/users.cpp | 3 |
4 files changed, 5 insertions, 14 deletions
diff --git a/src/listensocket.cpp b/src/listensocket.cpp index dc588386d..b56e97025 100644 --- a/src/listensocket.cpp +++ b/src/listensocket.cpp @@ -28,7 +28,8 @@ ListenSocket::ListenSocket(ConfigTag* tag, const irc::sockets::sockaddrs& bind_to) : bind_tag(tag) { - irc::sockets::satoap(bind_to, bind_addr, bind_port); + bind_addr = bind_to.addr(); + bind_port = bind_to.port(); bind_desc = bind_to.str(); fd = socket(bind_to.sa.sa_family, SOCK_STREAM, 0); diff --git a/src/modules/m_httpd.cpp b/src/modules/m_httpd.cpp index 961a70473..05112eb9c 100644 --- a/src/modules/m_httpd.cpp +++ b/src/modules/m_httpd.cpp @@ -408,10 +408,8 @@ class ModuleHttpServer : public Module { if (from->bind_tag->getString("type") != "httpd") return MOD_RES_PASSTHRU; - int port; - std::string incomingip; - irc::sockets::satoap(*client, incomingip, port); - sockets.push_front(new HttpServerSocket(nfd, incomingip, from, client, server, timeoutsec)); + + sockets.push_front(new HttpServerSocket(nfd, client->addr(), from, client, server, timeoutsec)); return MOD_RES_ALLOW; } diff --git a/src/socket.cpp b/src/socket.cpp index 018e0b0db..0ba57a810 100644 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -159,13 +159,6 @@ std::string irc::sockets::sockaddrs::addr() const return ""; } -bool irc::sockets::satoap(const irc::sockets::sockaddrs& sa, std::string& addr, int &port) -{ - port = sa.port(); - addr = sa.addr(); - return !addr.empty(); -} - std::string irc::sockets::sockaddrs::str() const { if (sa.sa_family == AF_INET) diff --git a/src/users.cpp b/src/users.cpp index dd0d54286..7d72692d9 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -681,10 +681,9 @@ int LocalUser::GetServerPort() const std::string& User::GetIPString() { - int port; if (cachedip.empty()) { - irc::sockets::satoap(client_sa, cachedip, port); + cachedip = client_sa.addr(); /* IP addresses starting with a : on irc are a Bad Thing (tm) */ if (cachedip[0] == ':') cachedip.insert(cachedip.begin(),1,'0'); |