]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
bump v1.3.5
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 20 Nov 2012 00:21:19 +0000 (18:21 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Tue, 20 Nov 2012 00:21:25 +0000 (18:21 -0600)
configure.in
src/include/switch_pgsql.h
src/switch_core_sqldb.c
src/switch_pgsql.c

index c1a43ea1706bf694736a56e00e063664280836bb..52d884f09073dfe6851e83eaade6ed118c4ca18b 100644 (file)
@@ -3,10 +3,10 @@
 
 # Must change all of the below together
 # For a release, set revision for that tagged release as well and uncomment
-AC_INIT([freeswitch], [1.3.5b], bugs@freeswitch.org)
+AC_INIT([freeswitch], [1.3.5], bugs@freeswitch.org)
 AC_SUBST(SWITCH_VERSION_MAJOR, [1])
 AC_SUBST(SWITCH_VERSION_MINOR, [3])
-AC_SUBST(SWITCH_VERSION_MICRO, [5b])
+AC_SUBST(SWITCH_VERSION_MICRO, [5])
 AC_SUBST(SWITCH_VERSION_REVISION, [])
 AC_SUBST(SWITCH_VERSION_REVISION_HUMAN, [])
 
index 00da8efffae6762ab147f516ec8c5c065e2c21bf..ff4e83f11a12a5ed9625427b641e1d5b2f026495 100644 (file)
@@ -156,6 +156,8 @@ SWITCH_DECLARE(switch_pgsql_status_t) switch_pgsql_handle_callback_exec_detailed
 SWITCH_DECLARE(char *) switch_pgsql_handle_get_error(switch_pgsql_handle_t *handle);
 
 SWITCH_DECLARE(int) switch_pgsql_handle_affected_rows(switch_pgsql_handle_t *handle);
+SWITCH_DECLARE(switch_pgsql_status_t) switch_pgsql_flush(switch_pgsql_handle_t *handle);
+
 
 SWITCH_END_EXTERN_C
 #endif
index 7d1e6c8716fb2ba50e5f02512e1e27680af5cd99..b776a14a877b70d2a7fc42ec1723beb36fd6e305 100644 (file)
@@ -293,6 +293,17 @@ SWITCH_DECLARE(void) switch_cache_db_flush_handles(void)
 SWITCH_DECLARE(void) switch_cache_db_release_db_handle(switch_cache_db_handle_t **dbh)
 {
        if (dbh && *dbh) {
+
+               switch((*dbh)->type) {
+               case SCDB_TYPE_PGSQL:
+                       {
+                               switch_pgsql_flush((*dbh)->native_handle.pgsql_dbh);
+                       }
+                       break;
+               default:
+                       break;
+               }
+
                switch_mutex_lock(sql_manager.dbh_mutex);
                (*dbh)->last_used = switch_epoch_time_now(NULL);
 
@@ -406,7 +417,7 @@ SWITCH_DECLARE(switch_status_t) _switch_cache_db_get_db_handle(switch_cache_db_h
        switch (type) {
        case SCDB_TYPE_PGSQL:
                {
-                       db_name = connection_options->odbc_options.dsn;
+                       db_name = connection_options->pgsql_options.dsn;
                        odbc_user = NULL;
                        odbc_pass = NULL;
                }
index f326305657ebdade2be07f485d233643d99374cf..6d6bd656e95a37f4573319a74b231a68c5efd17c 100644 (file)
@@ -276,11 +276,8 @@ SWITCH_DECLARE(switch_pgsql_status_t) switch_pgsql_cancel_real(const char *file,
                ret = SWITCH_PGSQL_FAIL;
        }
        PQfreeCancel(cancel);
-       {
-               PGresult *tmp = NULL;
-               /* Make sure the query is fully cancelled */
-               while ((tmp = PQgetResult(handle->con)) != NULL) PQclear(tmp);
-       }
+       switch_pgsql_flush(handle);
+
 #endif
        return ret;
 }
@@ -427,14 +424,13 @@ SWITCH_DECLARE(switch_pgsql_status_t) switch_pgsql_next_result_timed(switch_pgsq
 
        return SWITCH_PGSQL_SUCCESS;
  error:
-       {
-               PGresult *tmp = NULL;
-               /* Make sure the failed connection does not have any transactions marked as in progress */
-               while ((tmp = PQgetResult(handle->con)) != NULL) PQclear(tmp);
 
-               /* Try to reconnect to the DB if we were dropped */
-               db_is_up(handle);
-       }
+       /* Make sure the failed connection does not have any transactions marked as in progress */
+       switch_pgsql_flush(handle);
+
+       /* Try to reconnect to the DB if we were dropped */
+       db_is_up(handle);
+
 #endif
        return SWITCH_PGSQL_FAIL;
 }
@@ -572,6 +568,9 @@ SWITCH_DECLARE(switch_pgsql_status_t) switch_pgsql_handle_exec_base_detailed(con
 #ifdef SWITCH_HAVE_PGSQL
        char *err_str = NULL, *er = NULL;
 
+
+
+       switch_pgsql_flush(handle);
        handle->affected_rows = 0;
 
        if (!db_is_up(handle)) {
@@ -829,6 +828,29 @@ SWITCH_DECLARE(switch_pgsql_status_t) switch_pgsql_SQLSetAutoCommitAttr(switch_p
 #endif
 }
 
+SWITCH_DECLARE(switch_pgsql_status_t) switch_pgsql_flush(switch_pgsql_handle_t *handle)
+{
+#ifdef SWITCH_HAVE_PGSQL
+
+       PGresult *tmp = NULL;
+       int x = 0;
+
+       /* Make sure the query is fully cleared */
+       while ((tmp = PQgetResult(handle->con)) != NULL) {
+               PQclear(tmp);
+               x++;
+       }
+       
+       if (x) {
+               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG10, "Flushing %d results\n", x);
+       }
+
+       return SWITCH_PGSQL_SUCCESS;
+#else
+       return (switch_pgsql_status_t) SWITCH_FALSE;
+#endif
+}
+
 SWITCH_DECLARE(switch_pgsql_status_t) switch_pgsql_SQLEndTran(switch_pgsql_handle_t *handle, switch_bool_t commit)
 {
 #ifdef SWITCH_HAVE_PGSQL