]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Update PGSQL socket descriptor on reconnect in case a new descriptor was assigned.
authorEliot Gable <egable@gmail.com>
Thu, 8 Nov 2012 19:49:08 +0000 (19:49 +0000)
committerEliot Gable <egable@gmail.com>
Thu, 8 Nov 2012 19:49:14 +0000 (19:49 +0000)
src/switch_pgsql.c

index 4264f86e917f6dbfbcfeb4e0c5b691268f9c8ba7..f326305657ebdade2be07f485d233643d99374cf 100644 (file)
@@ -135,6 +135,7 @@ static int db_is_up(switch_pgsql_handle_t *handle)
                        goto error;
                }
                handle->state = SWITCH_PGSQL_STATE_CONNECTED;
+               handle->sock = PQsocket(handle->con);
        }
 
 /*     if (!PQsendQuery(handle->con, "SELECT 1")) {
@@ -167,6 +168,7 @@ static int db_is_up(switch_pgsql_handle_t *handle)
                if (PQstatus(handle->con) == CONNECTION_OK) {
                        handle->state = SWITCH_PGSQL_STATE_CONNECTED;
                        recon = SWITCH_PGSQL_SUCCESS;
+                       handle->sock = PQsocket(handle->con);
                }
        }