Module: kamailio
Branch: master
Commit: a8c23061bf2b9ce2240cd52e554b440cb996bc9e
URL:
https://github.com/kamailio/kamailio/commit/a8c23061bf2b9ce2240cd52e554b440…
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_unixodbc: revert tls_threads_mode=1
---
Modified: src/modules/db_unixodbc/dbase.c
---
Diff:
https://github.com/kamailio/kamailio/commit/a8c23061bf2b9ce2240cd52e554b440…
Patch:
https://github.com/kamailio/kamailio/commit/a8c23061bf2b9ce2240cd52e554b440…
---
diff --git a/src/modules/db_unixodbc/dbase.c b/src/modules/db_unixodbc/dbase.c
index 0637a1f6afd..11724a28b23 100644
--- a/src/modules/db_unixodbc/dbase.c
+++ b/src/modules/db_unixodbc/dbase.c
@@ -27,10 +27,6 @@
#include "../../core/mem/mem.h"
#include "../../core/dprint.h"
#include "../../core/async_task.h"
-#define KSR_RTHREAD_NEED_4PP
-#define KSR_RTHREAD_NEED_4P5I2P2
-#define KSR_RTHREAD_NEED_0P
-#include "../../core/rthreads.h"
#include "../../lib/srdb1/db_query.h"
#include "val.h"
#include "connection.h"
@@ -86,7 +82,7 @@ static int reconnect(const db1_con_t *_h)
/*
* Send an SQL query to the server
*/
-static int db_unixodbc_submit_query_impl(const db1_con_t *_h, const str *_s)
+static int db_unixodbc_submit_query(const db1_con_t *_h, const str *_s)
{
int ret = 0;
SQLCHAR sqlstate[7];
@@ -160,11 +156,6 @@ static int db_unixodbc_submit_query_impl(const db1_con_t *_h, const
str *_s)
return ret;
}
-static int db_unixodbc_submit_query(const db1_con_t *_h, const str *_s)
-{
- return run_thread4PP((_thread_proto4PP)db_unixodbc_submit_query_impl,
- (void *)_h, (void *)_s);
-}
/**
*
*/
@@ -238,9 +229,8 @@ extern char *db_unixodbc_tquote;
* Initialize database module
* No function should be called before this
*
- * Init libssl in a thread
- */
-static db1_con_t *db_unixodbc_init0(const str *_url)
+ */
+db1_con_t *db_unixodbc_init(const str *_url)
{
db1_con_t *c;
c = db_do_init(_url, (void *)db_unixodbc_new_connection);
@@ -249,23 +239,13 @@ static db1_con_t *db_unixodbc_init0(const str *_url)
return c;
}
-db1_con_t *db_unixodbc_init(const str *_url)
-{
- return run_threadP((_thread_proto)&db_unixodbc_init0, (void *)_url);
-}
-
/*
* Shut down database module
* No function should be called after this
*/
-static void db_unixodbc_close_impl(db1_con_t *_h)
-{
- return db_do_close(_h, db_unixodbc_free_connection);
-}
-
void db_unixodbc_close(db1_con_t *_h)
{
- run_thread0P((_thread_proto0P)db_unixodbc_close_impl, _h);
+ return db_do_close(_h, db_unixodbc_free_connection);
}
/*
@@ -308,7 +288,7 @@ static int db_unixodbc_store_result(const db1_con_t *_h, db1_res_t
**_r)
/*
* Release a result set from memory
*/
-static int db_unixodbc_free_result_impl(db1_con_t *_h, db1_res_t *_r)
+int db_unixodbc_free_result(db1_con_t *_h, db1_res_t *_r)
{
if((!_h) || (!_r)) {
LM_ERR("invalid parameter value\n");
@@ -324,12 +304,6 @@ static int db_unixodbc_free_result_impl(db1_con_t *_h, db1_res_t
*_r)
return 0;
}
-int db_unixodbc_free_result(db1_con_t *_h, db1_res_t *_r)
-{
- return run_thread4PP(
- (_thread_proto4PP)db_unixodbc_free_result_impl, _h, _r);
-}
-
/*
* Query table for specified rows
* _h: structure representing database connection
@@ -341,7 +315,7 @@ int db_unixodbc_free_result(db1_con_t *_h, db1_res_t *_r)
* _nc: number of columns to return
* _o: order by the specified column
*/
-static int db_unixodbc_query_impl(const db1_con_t *_h, const db_key_t *_k,
+int db_unixodbc_query(const db1_con_t *_h, const db_key_t *_k,
const db_op_t *_op, const db_val_t *_v, const db_key_t *_c,
const int _n, const int _nc, const db_key_t _o, db1_res_t **_r)
{
@@ -350,15 +324,6 @@ static int db_unixodbc_query_impl(const db1_con_t *_h, const db_key_t
*_k,
db_unixodbc_store_result);
}
-int db_unixodbc_query(const db1_con_t *_h, const db_key_t *_k,
- const db_op_t *_op, const db_val_t *_v, const db_key_t *_c,
- const int _n, const int _nc, const db_key_t _o, db1_res_t **_r)
-{
- return run_thread4P5I2P2((_thread_proto4P5I2P2)db_unixodbc_query_impl,
- (void *)_h, (void *)_k, (void *)_op, (void *)_v, (void *)_c, _n,
- _nc, (void *)_o, (void *)_r);
-}
-
/*!
* \brief Gets a partial result set, fetch rows from a result
*