]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/extra/m_mysql.cpp
/usr/local/include/openssl/pqueue.h:73: error: ISO C++ does not support `long long'
[user/henk/code/inspircd.git] / src / modules / extra / m_mysql.cpp
index 6605bed3c2f7722de92e2b5f99c1ccc869df27d0..1feb3b02b90f7779b96a5383f6101efc57daa894 100644 (file)
@@ -25,6 +25,7 @@
 /* $CompileFlags: exec("mysql_config --include") */
 /* $LinkerFlags: exec("mysql_config --libs_r") rpath("mysql_config --libs_r") */
 /* $ModDep: m_sqlv2.h */
+/* $NoPedantic */
 
 /* THE NONBLOCKING MYSQL API!
  * 
@@ -624,7 +625,7 @@ void* DispatcherThread(void* arg);
 
 /** Used by m_mysql to notify one thread when the other has a result
  */
-class Notifier : public InspSocket
+class Notifier : public BufferedSocket
 {
        insp_sockaddr sock_us;
        socklen_t uslen;
@@ -634,9 +635,9 @@ class Notifier : public InspSocket
 
        /* Create a socket on a random port. Let the tcp stack allocate us an available port */
 #ifdef IPV6
-       Notifier(InspIRCd* SI) : InspSocket(SI, "::1", 0, true, 3000)
+       Notifier(InspIRCd* SI) : BufferedSocket(SI, "::1", 0, true, 3000)
 #else
-       Notifier(InspIRCd* SI) : InspSocket(SI, "127.0.0.1", 0, true, 3000)
+       Notifier(InspIRCd* SI) : BufferedSocket(SI, "127.0.0.1", 0, true, 3000)
 #endif
        {
                uslen = sizeof(sock_us);
@@ -646,7 +647,7 @@ class Notifier : public InspSocket
                }
        }
 
-       Notifier(InspIRCd* SI, int newfd, char* ip) : InspSocket(SI, newfd, ip)
+       Notifier(InspIRCd* SI, int newfd, char* ip) : BufferedSocket(SI, newfd, ip)
        {
        }
 
@@ -676,7 +677,7 @@ class Notifier : public InspSocket
                 * The function GetCharId translates a single character
                 * back into an iterator.
                 */
-               if (read(this->GetFd(), &data, 1) > 0)
+               if (Instance->SE->Recv(this, &data, 1, 0) > 0)
                {
                        ConnMap::iterator iter = GetCharId(data);
                        if (iter != Connections.end())
@@ -713,7 +714,7 @@ class ModuleSQL : public Module
        ModuleSQL(InspIRCd* Me)
        : Module::Module(Me), rehashing(false)
        {
-               ServerInstance->UseInterface("SQLutils");
+               ServerInstance->Modules->UseInterface("SQLutils");
 
                Conf = new ConfigReader(ServerInstance);
                PublicServerInstance = ServerInstance;
@@ -730,24 +731,24 @@ class ModuleSQL : public Module
                        throw ModuleException("m_mysql: Failed to create dispatcher thread: " + std::string(strerror(errno)));
                }
 
-               if (!ServerInstance->PublishFeature("SQL", this))
+               if (!ServerInstance->Modules->PublishFeature("SQL", this))
                {
                        /* Tell worker thread to exit NOW */
                        giveup = true;
                        throw ModuleException("m_mysql: Unable to publish feature 'SQL'");
                }
 
-               ServerInstance->PublishInterface("SQL", this);
+               ServerInstance->Modules->PublishInterface("SQL", this);
        }
 
        virtual ~ModuleSQL()
        {
                giveup = true;
                ClearAllConnections();
-               DELETE(Conf);
-               ServerInstance->UnpublishInterface("SQL", this);
-               ServerInstance->UnpublishFeature("SQL");
-               ServerInstance->DoneWithInterface("SQLutils");
+               delete Conf;
+               ServerInstance->Modules->UnpublishInterface("SQL", this);
+               ServerInstance->Modules->UnpublishFeature("SQL");
+               ServerInstance->Modules->DoneWithInterface("SQLutils");
        }
 
 
@@ -796,7 +797,7 @@ class ModuleSQL : public Module
                return NULL;
        }
 
-       virtual void OnRehash(userrec* user, const std::string &parameter)
+       virtual void OnRehash(User* user, const std::string &parameter)
        {
                rehashing = true;
        }
@@ -885,5 +886,4 @@ void* DispatcherThread(void* arg)
        return NULL;
 }
 
-MODULE_INIT(ModuleSQL);
-
+MODULE_INIT(ModuleSQL)