Module: kamailio
Branch: master
Commit: f04dec82e90ec7a3e6aea4ea8e9ed23b06b165c6
URL:
https://github.com/kamailio/kamailio/commit/f04dec82e90ec7a3e6aea4ea8e9ed23…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2015-01-25T11:00:28+01:00
db_postgress: disable initialization of libssl if tls is loaded
- based on the note from docs to avoid double attempt to init the ssl
library
-
http://www.postgresql.org/docs/9.4/static/libpq-ssl.html
---
Modified: modules/db_postgres/km_pg_con.c
---
Diff:
https://github.com/kamailio/kamailio/commit/f04dec82e90ec7a3e6aea4ea8e9ed23…
Patch:
https://github.com/kamailio/kamailio/commit/f04dec82e90ec7a3e6aea4ea8e9ed23…
---
diff --git a/modules/db_postgres/km_pg_con.c b/modules/db_postgres/km_pg_con.c
index 77998d8..d053c55 100644
--- a/modules/db_postgres/km_pg_con.c
+++ b/modules/db_postgres/km_pg_con.c
@@ -30,6 +30,7 @@
#include "../../mem/mem.h"
#include "../../dprint.h"
#include "../../ut.h"
+#include "../../tls_hooks_init.h"
#include <string.h>
#include <time.h>
#include <netinet/in.h>
@@ -98,6 +99,9 @@ struct pg_con* db_postgres_new_connection(struct db_id* id)
keywords[i] = values[i] = NULL;
+ /* don't attempt to re-init openssl if done already */
+ if(tls_loaded()) PQinitSSL(0);
+
ptr->con = PQconnectdbParams(keywords, values, 1);
LM_DBG("PQconnectdbParams(%p)\n", ptr->con);