Module: kamailio
Branch: master
Commit: e33911f5edbac36f54b6371f9b952b57488bcced
URL:
https://github.com/kamailio/kamailio/commit/e33911f5edbac36f54b6371f9b952b5…
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_postgres: libssl thread guard for db_postgres_close
---
Modified: src/modules/db_postgres/km_dbase.c
---
Diff:
https://github.com/kamailio/kamailio/commit/e33911f5edbac36f54b6371f9b952b5…
Patch:
https://github.com/kamailio/kamailio/commit/e33911f5edbac36f54b6371f9b952b5…
---
diff --git a/src/modules/db_postgres/km_dbase.c b/src/modules/db_postgres/km_dbase.c
index 7948ff0075f..e8dce6e09ea 100644
--- a/src/modules/db_postgres/km_dbase.c
+++ b/src/modules/db_postgres/km_dbase.c
@@ -45,6 +45,7 @@
#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"
@@ -147,11 +148,16 @@ db1_con_t *db_postgres_init2(const str *_url, db_pooling_t pooling)
* \param _h closed connection, as returned from db_postgres_init
* \note free all memory and resources
*/
-void db_postgres_close(db1_con_t *_h)
+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);
+}
+
/*!
* \brief Submit_query, run a query