From 2d29904f252c7e7bb7c7cdfe9b6f095e3fb8f5d9 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Mon, 6 Jan 2020 10:16:42 +0100 Subject: [PATCH] Clean up curl openssl check Only set HAVE_CURL_OPENSSL flag, and remove Windows specific code, as all of this is only relevant for OpenSSL < 1.1, which is not used on Windows. --- ext/curl/config.m4 | 2 -- ext/curl/config.w32 | 1 - ext/curl/interface.c | 17 ++++++----------- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/ext/curl/config.m4 b/ext/curl/config.m4 index 6e8d36b8a2..4879cd3da2 100644 --- a/ext/curl/config.m4 +++ b/ext/curl/config.m4 @@ -23,8 +23,6 @@ if test "$PHP_CURL" != "no"; then esac if test "$CURL_SSL" = yes; then - AC_DEFINE([HAVE_CURL_SSL], [1], [Have cURL with SSL support]) - save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $CURL_CFLAGS" save_LDFLAGS="$LDFLAGS" diff --git a/ext/curl/config.w32 b/ext/curl/config.w32 index 515747f893..8ff6718b60 100644 --- a/ext/curl/config.w32 +++ b/ext/curl/config.w32 @@ -28,7 +28,6 @@ if (PHP_CURL != "no") { ) { EXTENSION("curl", "interface.c multi.c share.c curl_file.c"); AC_DEFINE('HAVE_CURL', 1, 'Have cURL library'); - AC_DEFINE('HAVE_CURL_SSL', 1, 'Have SSL suppurt in cURL'); ADD_FLAG("CFLAGS_CURL", "/D CURL_STATICLIB"); // TODO: check for curl_version_info } else { diff --git a/ext/curl/interface.c b/ext/curl/interface.c index 39d74b27d1..4e17e29159 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -43,22 +43,17 @@ #endif /* {{{ cruft for thread safe SSL crypto locks */ -#if defined(ZTS) && defined(HAVE_CURL_SSL) -# ifdef PHP_WIN32 +#if defined(ZTS) && defined(HAVE_CURL_OPENSSL) +# if defined(HAVE_OPENSSL_CRYPTO_H) # define PHP_CURL_NEED_OPENSSL_TSL # include -# elif defined(HAVE_CURL_OPENSSL) -# if defined(HAVE_OPENSSL_CRYPTO_H) -# define PHP_CURL_NEED_OPENSSL_TSL -# include -# else -# warning \ +# else +# warning \ "libcurl was compiled with OpenSSL support, but configure could not find " \ "openssl/crypto.h; thus no SSL crypto locking callbacks will be set, which may " \ "cause random crashes on SSL requests" -# endif -# endif /* HAVE_CURL_OPENSSL */ -#endif /* ZTS && HAVE_CURL_SSL */ +# endif +#endif /* ZTS && HAVE_CURL_OPENSSL */ /* }}} */ #define SMART_STR_PREALLOC 4096 -- 2.40.0