Module: kamailio
Branch: master
Commit: b7694edb65db852ee5a935fbbfe6f9d8c05fa508
URL:
https://github.com/kamailio/kamailio/commit/b7694edb65db852ee5a935fbbfe6f9d…
Author: S-P Chan <shihping.chan(a)gmail.com>
Committer: S-P Chan <shihping.chan(a)gmail.com>
Date: 2024-12-20T16:27:07+08:00
db_postgres: revert tls_threads_mode=1
---
Modified: src/modules/db_postgres/km_dbase.c
---
Diff:
https://github.com/kamailio/kamailio/commit/b7694edb65db852ee5a935fbbfe6f9d…
Patch:
https://github.com/kamailio/kamailio/commit/b7694edb65db852ee5a935fbbfe6f9d…
---
diff --git a/src/modules/db_postgres/km_dbase.c b/src/modules/db_postgres/km_dbase.c
index b816599096a..8cb92a1d1e5 100644
--- a/src/modules/db_postgres/km_dbase.c
+++ b/src/modules/db_postgres/km_dbase.c
@@ -45,10 +45,6 @@
#include "../../core/locking.h"
#include "../../core/hashes.h"
#include "../../core/clist.h"
-#define KSR_RTHREAD_NEED_PI
-#define KSR_RTHREAD_NEED_4PP
-#define KSR_RTHREAD_NEED_0P
-#include "../../core/rthreads.h"
#include "km_dbase.h"
#include "km_pg_con.h"
#include "km_val.h"
@@ -115,17 +111,12 @@ static void db_postgres_free_query(const db1_con_t *_con);
* \return database connection on success, NULL on error
* \note this function must be called prior to any database functions
*
- * Init libssl in a thread
*/
-static db1_con_t *db_postgres_init0(const str *_url)
+db1_con_t *db_postgres_init(const str *_url)
{
return db_do_init(_url, (void *)db_postgres_new_connection);
}
-db1_con_t *db_postgres_init(const str *_url)
-{
- return run_threadP((_thread_proto)db_postgres_init0, (void *)_url);
-}
/*!
* \brief Initialize database for future queries, specify pooling
* \param _url URL of the database that should be opened
@@ -135,39 +126,28 @@ db1_con_t *db_postgres_init(const str *_url)
*
* Init libssl in thread
*/
-static db1_con_t *db_postgres_init2_impl(const str *_url, db_pooling_t pooling)
+db1_con_t *db_postgres_init2(const str *_url, db_pooling_t pooling)
{
return db_do_init2(_url, (void *)db_postgres_new_connection, pooling);
}
-db1_con_t *db_postgres_init2(const str *_url, db_pooling_t pooling)
-{
- return run_threadPI(
- (_thread_protoPI)db_postgres_init2_impl, (void *)_url, pooling);
-}
/*!
* \brief Close database when the database is no longer needed
* \param _h closed connection, as returned from db_postgres_init
* \note free all memory and resources
*/
-static void db_postgres_close_impl(db1_con_t *_h)
-{
- db_do_close(_h, db_postgres_free_connection);
-}
-
void db_postgres_close(db1_con_t *_h)
{
- run_thread0P((_thread_proto0P)db_postgres_close_impl, _h);
+ db_do_close(_h, db_postgres_free_connection);
}
-
/*!
* \brief Submit_query, run a query
* \param _con database connection
* \param _s query string
* \return 0 on success, negative on failure
*/
-static int db_postgres_submit_query_impl(const db1_con_t *_con, const str *_s)
+static int db_postgres_submit_query(const db1_con_t *_con, const str *_s)
{
char *s = NULL;
int i, retries;
@@ -295,12 +275,6 @@ static int db_postgres_submit_query_impl(const db1_con_t *_con, const
str *_s)
return -1;
}
-static int db_postgres_submit_query(const db1_con_t *_con, const str *_s)
-{
- return run_thread4PP((_thread_proto4PP)db_postgres_submit_query_impl,
- (void *)_con, (void *)_s);
-}
-
void db_postgres_async_exec_task(void *param)
{
str *p;