소스 검색

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
Daniel-Constantin Mierla 10 년 전
부모
커밋
f04dec82e9
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      modules/db_postgres/km_pg_con.c

+ 4 - 0
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);