Module: kamailio
Branch: master
Commit: 7043a581c4cfe05d6f9a0161368a61f7c67e326c
URL:
https://github.com/kamailio/kamailio/commit/7043a581c4cfe05d6f9a0161368a61f…
Author: S-P Chan <shihping.chan(a)gmail.com>
Committer: S-P Chan <shihping.chan(a)gmail.com>
Date: 2024-02-09T07:05:17+08:00
db_mysql: libssl thread guard for db_mysql_close
---
Modified: src/modules/db_mysql/km_dbase.c
---
Diff:
https://github.com/kamailio/kamailio/commit/7043a581c4cfe05d6f9a0161368a61f…
Patch:
https://github.com/kamailio/kamailio/commit/7043a581c4cfe05d6f9a0161368a61f…
---
diff --git a/src/modules/db_mysql/km_dbase.c b/src/modules/db_mysql/km_dbase.c
index e86e4a0391b..7b65c0a012c 100644
--- a/src/modules/db_mysql/km_dbase.c
+++ b/src/modules/db_mysql/km_dbase.c
@@ -40,6 +40,7 @@
#include "../../core/async_task.h"
#define KSR_RTHREAD_NEED_4PP
+#define KSR_RTHREAD_NEED_0P
#include "../../core/rthreads.h"
#include "../../lib/srdb1/db_query.h"
#include "../../lib/srdb1/db_ut.h"
@@ -228,11 +229,16 @@ db1_con_t *db_mysql_init(const str *_url)
* \param _h handle to the closed connection
* \return zero on success, negative value on failure
*/
-void db_mysql_close(db1_con_t *_h)
+static void db_mysql_close_impl(db1_con_t *_h)
{
db_do_close(_h, db_mysql_free_connection);
}
+void db_mysql_close(db1_con_t *_h)
+{
+ run_thread0P((_thread_proto0P)db_mysql_close_impl, _h);
+}
+
/**
* Retrieve a result set