Module: kamailio
Branch: 5.7
Commit: 63009ee559bb68a3fde0b7f479d3023b06a6c376
URL: 
https://github.com/kamailio/kamailio/commit/63009ee559bb68a3fde0b7f479d3023b06a6c376

Author: S-P Chan <shihping.c...@gmail.com>
Committer: S-P Chan <shihping.c...@gmail.com>
Date: 2024-02-06T13:14:12+08:00

db_postgres: handle SSL and submit query

(cherry-pick from d638c774ed816eec800e72ba2546004215cfe097)

---

Modified: src/modules/db_postgres/km_dbase.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/63009ee559bb68a3fde0b7f479d3023b06a6c376.diff
Patch: 
https://github.com/kamailio/kamailio/commit/63009ee559bb68a3fde0b7f479d3023b06a6c376.patch

---

diff --git a/src/modules/db_postgres/km_dbase.c 
b/src/modules/db_postgres/km_dbase.c
index 3d58f1a53e0..7948ff0075f 100644
--- a/src/modules/db_postgres/km_dbase.c
+++ b/src/modules/db_postgres/km_dbase.c
@@ -44,6 +44,7 @@
 #include "../../core/hashes.h"
 #include "../../core/clist.h"
 #define KSR_RTHREAD_NEED_PI
+#define KSR_RTHREAD_NEED_4PP
 #include "../../core/rthreads.h"
 #include "km_dbase.h"
 #include "km_pg_con.h"
@@ -158,7 +159,7 @@ void db_postgres_close(db1_con_t *_h)
  * \param _s query string
  * \return 0 on success, negative on failure
  */
-static int db_postgres_submit_query(const db1_con_t *_con, const str *_s)
+static int db_postgres_submit_query_impl(const db1_con_t *_con, const str *_s)
 {
        char *s = NULL;
        int i, retries;
@@ -286,6 +287,12 @@ static int db_postgres_submit_query(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;

_______________________________________________
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org

Reply via email to