aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGisle Vanem <gvanem@yahoo.no>2016-03-17 10:42:33 +0100
committerDaniel Stenberg <daniel@haxx.se>2016-03-17 10:42:33 +0100
commitd816e8cf52ff031d3af97a7fd93c1886bfda76e4 (patch)
tree397522b85070ee320d6800b9a1a7a6d15071208a /lib
parent8d9d03a1576798d6f1e32ca3d2294f030f94ef1a (diff)
openssl: adapt to API breakage in ERR_remove_thread_state()
The OpenSSL API change that broke this is "Convert ERR_STATE to new multi-threading API": openssl commit 8509dcc. Closes #713
Diffstat (limited to 'lib')
-rw-r--r--lib/vtls/openssl.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c
index 3b19369f1..540800d1f 100644
--- a/lib/vtls/openssl.c
+++ b/lib/vtls/openssl.c
@@ -95,6 +95,10 @@
#if (OPENSSL_VERSION_NUMBER >= 0x10000000L)
#define HAVE_ERR_REMOVE_THREAD_STATE 1
+#if (OPENSSL_VERSION_NUMBER >= 0x10100004L)
+/* OpenSSL 1.1.0-pre4 removed the argument! */
+#define HAVE_ERR_REMOVE_THREAD_STATE_NOARG 1
+#endif
#endif
#if !defined(HAVE_SSLV2_CLIENT_METHOD) || \
@@ -731,7 +735,9 @@ void Curl_ossl_cleanup(void)
ERR_free_strings();
/* Free thread local error state, destroying hash upon zero refcount */
-#ifdef HAVE_ERR_REMOVE_THREAD_STATE
+#ifdef HAVE_ERR_REMOVE_THREAD_STATE_NOARG
+ ERR_remove_thread_state();
+#elif defined(HAVE_ERR_REMOVE_THREAD_STATE)
ERR_remove_thread_state(NULL);
#else
ERR_remove_state(0);