]> granicus.if.org Git - libevent/commitdiff
Do not check for ERR_remove_thread_state() (do not link ssl into every library)
authorPierce Lopez <pierce.lopez@gmail.com>
Fri, 3 Mar 2017 02:09:32 +0000 (21:09 -0500)
committerAzat Khuzhin <a3at.mail@gmail.com>
Sun, 5 Mar 2017 22:39:29 +0000 (01:39 +0300)
This reverts commit c4e9d9bd662de7f575f2172c160795d452ebe709
("sample/https-client: check for ERR_remove_thread_state() existence").

Calling AC_SEARCH_LIBS() modifies LIBS - -lcrypto incorrectly
ends up in LIBS, and thus linked to by libevent_core.so.

Checking for ERR_remove_thread_state should no longer be needed
because it was introduced in openssl 1.0.0, and the previous line
0.9.8 had support discontinued at the end of 2015.

Fixes: #473
CMakeLists.txt
configure.ac
event-config.h.cmake
sample/https-client.c

index cab56903c4d79c17d2b3e91cf37fb9aae8fd4bff..24eaa404d463a30c4c7ea01a30f943d4f8267b38 100644 (file)
@@ -879,10 +879,6 @@ if (NOT EVENT__DISABLE_SAMPLES)
         time-test)
 
     if (NOT EVENT__DISABLE_OPENSSL AND OPENSSL_LIBRARIES)
-        set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES})
-        CHECK_FUNCTION_EXISTS_EX(ERR_remove_thread_state EVENT__HAVE_ERR_REMOVE_THREAD_STATE)
-        set(CMAKE_REQUIRED_LIBRARIES "")
-
         # Special sample with more than one file.
         add_executable(https-client
             sample/https-client.c
index 660d2dcc9fc48dc5b46fff5d8aefd049fd28a1ac..47ba344a1f89d7130c162d985228d81f8edc50a4 100644 (file)
@@ -790,10 +790,6 @@ fi
 
 # check if we have and should use openssl
 AM_CONDITIONAL(OPENSSL, [test "$enable_openssl" != "no" && test "$have_openssl" = "yes"])
-if test "x$enable_openssl" = "xyes"; then
-       AC_SEARCH_LIBS([ERR_remove_thread_state], [crypto eay32],
-               [AC_DEFINE(HAVE_ERR_REMOVE_THREAD_STATE, 1, [Define to 1 if you have ERR_remove_thread_stat().])])
-fi
 
 # Add some more warnings which we use in development but not in the
 # released versions.  (Some relevant gcc versions can't handle these.)
index faa159b70397cf76e9d9bfe3f6615839c64ac81c..472ffe176653e2f2164f759b7abaf0ce4e53bc8a 100644 (file)
 
 #cmakedefine EVENT__NEED_DLLIMPORT
 
-/* Define to 1 if you have ERR_remove_thread_stat(). */
-#cmakedefine EVENT__HAVE_ERR_REMOVE_THREAD_STATE
-
 /* Define if waitpid() supports WNOWAIT */
 #cmakedefine EVENT__HAVE_WAITPID_WITH_WNOWAIT
 
index 18cea9063af2c1070c016b7fc02dbea40438266d..723951dd054c079b71880654f8f512eb3fde35e3 100644 (file)
@@ -492,11 +492,7 @@ cleanup:
        EVP_cleanup();
        ERR_free_strings();
 
-#ifdef EVENT__HAVE_ERR_REMOVE_THREAD_STATE
        ERR_remove_thread_state(NULL);
-#else
-       ERR_remove_state(0);
-#endif
        CRYPTO_cleanup_all_ex_data();
 
        sk_SSL_COMP_free(SSL_COMP_get_compression_methods());