]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/extra/m_pgsql.cpp
Remove dead code from the pgsql module.
[user/henk/code/inspircd.git] / src / modules / extra / m_pgsql.cpp
index 109725a4349e55513429434deb377fb06c2c9b98..c454befaed1db36867e41487769536184d6a0834 100644 (file)
@@ -55,14 +55,20 @@ class ModulePgSQL;
 
 typedef insp::flat_map<std::string, SQLConn*> ConnMap;
 
-/* CREAD,      Connecting and wants read event
- * CWRITE,     Connecting and wants write event
- * WREAD,      Connected/Working and wants read event
- * WWRITE,     Connected/Working and wants write event
- * RREAD,      Resetting and wants read event
- * RWRITE,     Resetting and wants write event
- */
-enum SQLstatus { CREAD, CWRITE, WREAD, WWRITE, RREAD, RWRITE };
+enum SQLstatus
+{
+       // Connecting and wants read event.
+       CREAD,
+
+       // Connecting and wants write event.
+       CWRITE,
+
+       // Connected/working and wants read event.
+       WREAD,
+
+       // Connected/working and wants write event.
+       WWRITE
+};
 
 class ReconnectTimer : public Timer
 {
@@ -385,30 +391,6 @@ restart:
                }
        }
 
-       bool DoResetPoll()
-       {
-               switch(PQresetPoll(sql))
-               {
-                       case PGRES_POLLING_WRITING:
-                               SocketEngine::ChangeEventMask(this, FD_WANT_POLL_WRITE | FD_WANT_NO_READ);
-                               status = CWRITE;
-                               return DoPoll();
-                       case PGRES_POLLING_READING:
-                               SocketEngine::ChangeEventMask(this, FD_WANT_POLL_READ | FD_WANT_NO_WRITE);
-                               status = CREAD;
-                               return true;
-                       case PGRES_POLLING_FAILED:
-                               return false;
-                       case PGRES_POLLING_OK:
-                               SocketEngine::ChangeEventMask(this, FD_WANT_POLL_READ | FD_WANT_NO_WRITE);
-                               status = WWRITE;
-                               DoConnectedPoll();
-                               return true;
-                       default:
-                               return true;
-               }
-       }
-
        void DelayReconnect();
 
        void DoEvent()
@@ -417,10 +399,6 @@ restart:
                {
                        DoPoll();
                }
-               else if((status == RREAD) || (status == RWRITE))
-               {
-                       DoResetPoll();
-               }
                else
                {
                        DoConnectedPoll();