Module: kamailio
Branch: 5.7
Commit: d2cc8657b06c8ca33c59c82dbf739d67a5ce8fa0
URL:
https://github.com/kamailio/kamailio/commit/d2cc8657b06c8ca33c59c82dbf739d6…
Author: S-P Chan <shihping.chan(a)gmail.com>
Committer: S-P Chan <shihping.chan(a)gmail.com>
Date: 2024-02-04T08:12:52+08:00
db_unixodbc: init libssl in a thread
From:
- 2611a4670c65dd32fc1daf6b67e37852936ba69c
- b71ce6e5733ab08b84ff09481ada91e5fca43a33
---
Modified: src/modules/db_unixodbc/dbase.c
---
Diff:
https://github.com/kamailio/kamailio/commit/d2cc8657b06c8ca33c59c82dbf739d6…
Patch:
https://github.com/kamailio/kamailio/commit/d2cc8657b06c8ca33c59c82dbf739d6…
---
diff --git a/src/modules/db_unixodbc/dbase.c b/src/modules/db_unixodbc/dbase.c
index eb02b29de50..c4ba64b019c 100644
--- a/src/modules/db_unixodbc/dbase.c
+++ b/src/modules/db_unixodbc/dbase.c
@@ -22,10 +22,10 @@
*
*/
-
#include "../../core/mem/mem.h"
#include "../../core/dprint.h"
#include "../../core/async_task.h"
+#include "../../core/rthreads.h"
#include "../../lib/srdb1/db_query.h"
#include "val.h"
#include "connection.h"
@@ -227,8 +227,10 @@ extern char *db_unixodbc_tquote;
/*
* Initialize database module
* No function should be called before this
+ *
+ * Init libssl in a thread
*/
-db1_con_t *db_unixodbc_init(const str *_url)
+static db1_con_t *db_unixodbc_init0(const str *_url)
{
db1_con_t *c;
c = db_do_init(_url, (void *)db_unixodbc_new_connection);
@@ -237,6 +239,11 @@ db1_con_t *db_unixodbc_init(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