You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by ns...@apache.org on 2016/10/01 14:57:37 UTC

[2/3] thrift git commit: THRIFT-3878: fix interop with newer OpenSSL libraries

THRIFT-3878: fix interop with newer OpenSSL libraries

This closes #1102


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/4bbfe612
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/4bbfe612
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/4bbfe612

Branch: refs/heads/master
Commit: 4bbfe6120e71b81df7f23dcc246990c29eb27859
Parents: 4d39ac5
Author: James E. King, III <ji...@simplivity.com>
Authored: Thu Sep 29 15:04:09 2016 -0400
Committer: Nobuaki Sukegawa <ns...@apache.org>
Committed: Sat Oct 1 23:40:03 2016 +0900

----------------------------------------------------------------------
 lib/cpp/src/thrift/transport/TSSLSocket.cpp | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/4bbfe612/lib/cpp/src/thrift/transport/TSSLSocket.cpp
----------------------------------------------------------------------
diff --git a/lib/cpp/src/thrift/transport/TSSLSocket.cpp b/lib/cpp/src/thrift/transport/TSSLSocket.cpp
index 517151f..1efb9f7 100644
--- a/lib/cpp/src/thrift/transport/TSSLSocket.cpp
+++ b/lib/cpp/src/thrift/transport/TSSLSocket.cpp
@@ -108,7 +108,12 @@ void initializeOpenSSL() {
   SSL_library_init();
   SSL_load_error_strings();
   // static locking
+  // newer versions of OpenSSL changed CRYPTO_num_locks - see THRIFT-3878
+#ifdef CRYPTO_num_locks
+  mutexes = boost::shared_array<Mutex>(new Mutex[CRYPTO_num_locks()]);
+#else
   mutexes = boost::shared_array<Mutex>(new Mutex[ ::CRYPTO_num_locks()]);
+#endif
   if (mutexes == NULL) {
     throw TTransportException(TTransportException::INTERNAL_ERROR,
                               "initializeOpenSSL() failed, "