summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorScott D Phillips <scott.d.phillips@intel.com>2016-11-28 15:57:33 -0800
committerSebastian Dröge <sebastian@centricular.com>2016-12-05 11:26:15 +0200
commit1a43d5735972c525b8cc69d46b392e903bb4a0aa (patch)
treede8b2cb5c3777fc8c9ca8c87fd89010bd961ac68 /ext
parentfc284f7b1ceee22d6e36058a4035359e2c2267fd (diff)
downloadgstreamer-plugins-bad-1a43d5735972c525b8cc69d46b392e903bb4a0aa.tar.gz
dtls: Set openssl's threadid the 1.0.x way
For pre-1.1.x openssl, a callback to set the thread id needs to be provided to openssl. In 0.9.x the thread id was an unsigned long. In 1.0.x it was expanded to be able to hold a void*. Here we change to use the 1.0.x API so that the thread id can always hold a GThread*, even on platforms like msvc x64 where unsigned long is only 32 bits. All of this is still #ifdef'd out of existence when building with openssl 1.1.x or later which changed the thread API again, and does not need a thread id callback. https://bugzilla.gnome.org/show_bug.cgi?id=775292
Diffstat (limited to 'ext')
-rw-r--r--ext/dtls/gstdtlsagent.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/dtls/gstdtlsagent.c b/ext/dtls/gstdtlsagent.c
index 6ec39fcbc..55500f95b 100644
--- a/ext/dtls/gstdtlsagent.c
+++ b/ext/dtls/gstdtlsagent.c
@@ -100,10 +100,10 @@ ssl_locking_function (gint mode, gint lock_num, const gchar * file, gint line)
}
}
-static gulong
-ssl_thread_id_function (void)
+static void
+ssl_thread_id_function (CRYPTO_THREADID * id)
{
- return (gulong) g_thread_self ();
+ CRYPTO_THREADID_set_pointer (id, g_thread_self ());
}
#endif
@@ -138,7 +138,7 @@ _gst_dtls_init_openssl (void)
g_rw_lock_init (&ssl_locks[i]);
}
CRYPTO_set_locking_callback (ssl_locking_function);
- CRYPTO_set_id_callback (ssl_thread_id_function);
+ CRYPTO_THREADID_set_callback (ssl_thread_id_function);
}
#endif