From: Eliot Gable Date: Thu, 8 Nov 2012 19:49:08 +0000 (+0000) Subject: Update PGSQL socket descriptor on reconnect in case a new descriptor was assigned. X-Git-Tag: v1.3.3~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=302c323a8f2602033cc466bd48c8e317cff5a6d1;p=thirdparty%2Ffreeswitch.git Update PGSQL socket descriptor on reconnect in case a new descriptor was assigned. --- diff --git a/src/switch_pgsql.c b/src/switch_pgsql.c index 4264f86e91..f326305657 100644 --- a/src/switch_pgsql.c +++ b/src/switch_pgsql.c @@ -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); } }