Jelajahi Sumber

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

(cherry picked from commit f04dec82e90ec7a3e6aea4ea8e9ed23b06b165c6)

Conflicts:
	modules/db_postgres/km_pg_con.c
Daniel-Constantin Mierla 10 tahun lalu
induk
melakukan
eeae005fb3
1 mengubah file dengan 4 tambahan dan 0 penghapusan
  1. 4 0
      modules/db_postgres/km_pg_con.c

+ 4 - 0
modules/db_postgres/km_pg_con.c

@@ -29,6 +29,7 @@
 #include "../../mem/mem.h"
 #include "../../dprint.h"
 #include "../../ut.h"
+#include "../../tls_hooks_init.h" 
 #include <string.h>
 #include <time.h>
 
@@ -74,6 +75,9 @@ struct pg_con* db_postgres_new_connection(struct db_id* id)
 			ZSW(id->database));
 	}
 
+	/* don't attempt to re-init openssl if done already */
+	if(tls_loaded()) PQinitSSL(0);
+
  	ptr->con = PQsetdbLogin(id->host, ports, NULL, NULL, id->database, id->username, id->password);
 	LM_DBG("PQsetdbLogin(%p)\n", ptr->con);