Skip to content
Snippets Groups Projects
Commit 485ec759 authored by Guillaume Roguez's avatar Guillaume Roguez Committed by Adrien Béraud
Browse files

contrib: fix random crash due to pjproject assert

Many functions in pjproject check for calling thread
and assert if this one is not previously registered
by the application.
This is the case of pj_log and this function can be called anywhere
at anytime, as our gnutls patch uses it for logging TLS error.
Our log function in our patch has not to be done as it calls
a log register function reserved for the final application, not library.
As a result of this, our tls session code, where a thread
is not registered to pjproject, may call pj_log a causes
an application.

This patch removes the logging stuff into our gnutls pjproject patch.
If logging needed, it must be implemented by the Ring daemon code
with ad-hoc automatic thread registration.

Change-Id: If8f9d86258473ac43c0456b514cc3a078fc18fd2
parent d19032de
Branches
Tags
No related merge requests found
...@@ -469,7 +469,7 @@ new file mode 100644 ...@@ -469,7 +469,7 @@ new file mode 100644
index 0000000..37bcaba index 0000000..37bcaba
--- /dev/null --- /dev/null
+++ b/pjlib/src/pj/ssl_sock_gtls.c +++ b/pjlib/src/pj/ssl_sock_gtls.c
@@ -0,0 +1,2887 @@ @@ -0,0 +1,2877 @@
+/* $Id$ */ +/* $Id$ */
+/* +/*
+ * Copyright (C) 2014-2016 Savoir-faire Linux. (https://www.savoirfairelinux.com) + * Copyright (C) 2014-2016 Savoir-faire Linux. (https://www.savoirfairelinux.com)
...@@ -926,13 +926,6 @@ index 0000000..37bcaba ...@@ -926,13 +926,6 @@ index 0000000..37bcaba
+} +}
+ +
+ +
+/* GnuTLS way of reporting internal operations. */
+static void tls_print_logs(int level, const char* msg)
+{
+ PJ_LOG(3, (THIS_FILE, "GnuTLS [%d]: %s", level, msg));
+}
+
+
+/* Initialize GnuTLS. */ +/* Initialize GnuTLS. */
+static pj_status_t tls_init(void) +static pj_status_t tls_init(void)
+{ +{
...@@ -948,9 +941,6 @@ index 0000000..37bcaba ...@@ -948,9 +941,6 @@ index 0000000..37bcaba
+ if (ret < 0) + if (ret < 0)
+ return tls_status_from_err(NULL, ret); + return tls_status_from_err(NULL, ret);
+ +
+ gnutls_global_set_log_level(GNUTLS_LOG_LEVEL);
+ gnutls_global_set_log_function(tls_print_logs);
+
+ /* Init available ciphers */ + /* Init available ciphers */
+ if (!tls_available_ciphers) { + if (!tls_available_ciphers) {
+ unsigned int i; + unsigned int i;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment