diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-09-09 08:54:36 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-09-09 08:54:36 +0000 |
commit | 92a0ff3ea9a4817b289a286a69c37d6c90370ae6 (patch) | |
tree | 6b7355869a315ea1de82fae69e51dbf173c1fe0f /src/modules | |
parent | b6497f2715d1df8ccc1461caa52ec600490e44b3 (diff) |
fix various bodge-ups, we must have been tired when fixing this in the first place to use the new api, methods are in the wrong places.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10483 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/extra/m_mysql.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/modules/extra/m_mysql.cpp b/src/modules/extra/m_mysql.cpp index ae66e44bb..5e6bcfce3 100644 --- a/src/modules/extra/m_mysql.cpp +++ b/src/modules/extra/m_mysql.cpp @@ -664,7 +664,7 @@ class Notifier : public BufferedSocket ModuleSQL* Parent; public: - Notifier(InspIRCd* SI, int newfd, char* ip) : BufferedSocket(SI, newfd, ip) { } + Notifier(ModuleSQL* P, InspIRCd* SI, int newfd, char* ip) : BufferedSocket(SI, newfd, ip), Parent(P) { } virtual bool OnDataReady() { @@ -702,12 +702,13 @@ class Notifier : public BufferedSocket */ class MySQLListener : public ListenSocketBase { + ModuleSQL* Parent; insp_sockaddr sock_us; socklen_t uslen; FileReader* index; public: - MySQLListener(InspIRCd* Instance, int port, const std::string &addr) : ListenSocketBase(Instance, port, addr) + MySQLListener(ModuleSQL* P, InspIRCd* Instance, int port, const std::string &addr) : ListenSocketBase(Instance, port, addr), Parent(P) { uslen = sizeof(sock_us); if (getsockname(this->fd,(sockaddr*)&sock_us,&uslen)) @@ -718,7 +719,7 @@ class MySQLListener : public ListenSocketBase virtual void OnAcceptReady(const std::string &ipconnectedto, int nfd, const std::string &incomingip) { - new Notifier(this->ServerInstance, nfd, (char *)ipconnectedto.c_str()); // XXX unsafe casts suck + new Notifier(this->Parent, this->ServerInstance, nfd, (char *)ipconnectedto.c_str()); // XXX unsafe casts suck } /* Using getsockname and ntohs, we can determine which port number we were allocated */ @@ -742,9 +743,9 @@ ModuleSQL::ModuleSQL(InspIRCd* Me) : Module(Me), rehashing(false) /* Create a socket on a random port. Let the tcp stack allocate us an available port */ #ifdef IPV6 - MessagePipe = new MySQLListener(ServerInstance, 0, "::1"); + MessagePipe = new MySQLListener(this, ServerInstance, 0, "::1"); #else - MessagePipe = new MySQLListener(ServerInstance, 0, "127.0.0.1"); + MessagePipe = new MySQLListener(this, ServerInstance, 0, "127.0.0.1"); #endif if (MessagePipe->GetFd() == -1) |