Module: kamailio
Branch: 5.7
Commit: 0936b6b70efe2e9d05766ce925ca10e4ff4bf7be
URL:
https://github.com/kamailio/kamailio/commit/0936b6b70efe2e9d05766ce925ca10e…
Author: S-P Chan <shihping.chan(a)gmail.com>
Committer: S-P Chan <shihping.chan(a)gmail.com>
Date: 2024-02-08T14:28:12+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/0936b6b70efe2e9d05766ce925ca10e…
Patch:
https://github.com/kamailio/kamailio/commit/0936b6b70efe2e9d05766ce925ca10e…
---
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