diff options
author | Sadie Powell <sadie@witchery.services> | 2020-04-23 13:46:49 +0100 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2020-04-23 14:40:19 +0100 |
commit | 426d1c8e7ef6186fa122477bb51f8e6023dda56b (patch) | |
tree | b2d78a954a221a02ca6c17c955b8fea74eab6155 | |
parent | 96e3b3c9bc377f7f73e7bf7c49a692951c3246fb (diff) |
Remove dead code from the pgsql module.
-rw-r--r-- | src/modules/extra/m_pgsql.cpp | 50 |
1 files changed, 14 insertions, 36 deletions
diff --git a/src/modules/extra/m_pgsql.cpp b/src/modules/extra/m_pgsql.cpp index 109725a43..c454befae 100644 --- a/src/modules/extra/m_pgsql.cpp +++ b/src/modules/extra/m_pgsql.cpp @@ -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(); |