diff options
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_httpd.cpp | 9 | ||||
-rw-r--r-- | src/modules/m_spanningtree/utils.cpp | 7 | ||||
-rw-r--r-- | src/modules/m_spanningtree/utils.h | 2 |
3 files changed, 12 insertions, 6 deletions
diff --git a/src/modules/m_httpd.cpp b/src/modules/m_httpd.cpp index c40f6055a..bdf4e424e 100644 --- a/src/modules/m_httpd.cpp +++ b/src/modules/m_httpd.cpp @@ -48,7 +48,7 @@ class HttpServerSocket : public BufferedSocket public: - HttpServerSocket(InspIRCd* SI, int newfd, char* ip, FileReader* ind) : BufferedSocket(SI, newfd, ip), index(ind), postsize(0) + HttpServerSocket(InspIRCd* SI, int newfd, const char* ip, FileReader* ind) : BufferedSocket(SI, newfd, ip), index(ind), postsize(0) { InternalState = HTTP_SERVE_WAIT_REQUEST; } @@ -353,9 +353,12 @@ class HttpListener : public ListenSocketBase this->index = idx; } - virtual void OnAcceptReady(const std::string &ipconnectedto, int nfd, const std::string &incomingip) + virtual void OnAcceptReady(int nfd) { - new HttpServerSocket(ServerInstance, nfd, (char *)incomingip.c_str(), index); // ugly cast courtesy of bufferedsocket + int port; + std::string incomingip; + irc::sockets::satoap(&client, incomingip, port); + new HttpServerSocket(ServerInstance, nfd, incomingip.c_str(), index); } }; diff --git a/src/modules/m_spanningtree/utils.cpp b/src/modules/m_spanningtree/utils.cpp index 8a17baf84..ee12712b8 100644 --- a/src/modules/m_spanningtree/utils.cpp +++ b/src/modules/m_spanningtree/utils.cpp @@ -29,10 +29,13 @@ /* $ModDep: m_spanningtree/resolvers.h m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/link.h m_spanningtree/treesocket.h */ /* Create server sockets off a listener. */ -void ServerSocketListener::OnAcceptReady(const std::string &ipconnectedto, int newsock, const std::string &incomingip) +void ServerSocketListener::OnAcceptReady(int newsock) { bool found = false; - char *ip = (char *)incomingip.c_str(); // XXX ugly cast + int port; + std::string incomingip; + irc::sockets::satoap(&client, incomingip, port); + char *ip = const_cast<char*>(incomingip.c_str()); found = (std::find(Utils->ValidIPs.begin(), Utils->ValidIPs.end(), ip) != Utils->ValidIPs.end()); if (!found) diff --git a/src/modules/m_spanningtree/utils.h b/src/modules/m_spanningtree/utils.h index a32b5a445..81c47267d 100644 --- a/src/modules/m_spanningtree/utils.h +++ b/src/modules/m_spanningtree/utils.h @@ -49,7 +49,7 @@ class ServerSocketListener : public ListenSocketBase this->Utils = u; } - virtual void OnAcceptReady(const std::string &ipconnectedto, int nfd, const std::string &incomingip); + virtual void OnAcceptReady(int nfd); }; typedef std::map<TreeServer*,TreeServer*> TreeServerList; |