- case CONNECTION_STARTED:
- Instance->Log(DEBUG, "PQstatus: CONNECTION_STARTED: Waiting for connection to be made.");
- break;
-
- case CONNECTION_MADE:
- Instance->Log(DEBUG, "PQstatus: CONNECTION_MADE: Connection OK; waiting to send.");
- break;
-
- case CONNECTION_AWAITING_RESPONSE:
- Instance->Log(DEBUG, "PQstatus: CONNECTION_AWAITING_RESPONSE: Waiting for a response from the server.");
- break;
-
- case CONNECTION_AUTH_OK:
- Instance->Log(DEBUG, "PQstatus: CONNECTION_AUTH_OK: Received authentication; waiting for backend start-up to finish.");
- break;
-
- case CONNECTION_SSL_STARTUP:
- Instance->Log(DEBUG, "PQstatus: CONNECTION_SSL_STARTUP: Negotiating SSL encryption.");
- break;
-
- case CONNECTION_SETENV:
- Instance->Log(DEBUG, "PQstatus: CONNECTION_SETENV: Negotiating environment-driven parameter settings.");
- break;
-
- default:
- Instance->Log(DEBUG, "PQstatus: ???");
- }
-}
-
-bool SQLConn::OnDataReady()
-{
- /* Always return true here, false would close the socket - we need to do that ourselves with the pgsql API */
- Instance->Log(DEBUG, "OnDataReady(): status = %s", StatusStr());
-
- return DoEvent();
-}
-
-bool SQLConn::OnWriteReady()
-{
- /* Always return true here, false would close the socket - we need to do that ourselves with the pgsql API */
- Instance->Log(DEBUG, "OnWriteReady(): status = %s", StatusStr());
-
- return DoEvent();
-}
-
-bool SQLConn::OnConnected()
-{
- Instance->Log(DEBUG, "OnConnected(): status = %s", StatusStr());
-
- return DoEvent();
-}
-
-bool SQLConn::Reconnect()
-{
- Instance->Log(DEBUG, "Initiating reconnect");
-
- if(PQresetStart(sql))
- {
- /* Successfully initiatied database reconnect,
- * set flags so PQresetPoll() will be called appropriately
- */
- status = RWRITE;
- qinprog = false;
- return true;