com php-src: Don't warn if libcurl SSL library not detected: ext/curl/config.m4 ext/curl/interface.c

From: Date: Wed, 12 Jun 2019 13:26:50 +0000
Subject: com php-src: Don't warn if libcurl SSL library not detected: ext/curl/config.m4 ext/curl/interface.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-106735@lists.php.net to get a copy of this message
Commit: bc8fece0cf43be05dcf5022b851d5429c8977401 Author: Nikita Popov <nikita.ppv@gmail.com> Wed, 12 Jun 2019 15:26:06 +0200 Parents: e1f65e2d97030d95fe5d31e2589a684c2220143e Branches: PHP-7.4 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=bc8fece0cf43be05dcf5022b851d5429c8977401 Log: Don't warn if libcurl SSL library not detected libcurl may link against 7 different ssl libraries, all of which are thread-safe -- apart from openssl, of course. We check for openssl and register locking callbacks in that case, but we should not warn if any other library is used. Changed paths: M ext/curl/config.m4 M ext/curl/interface.c Diff: diff --git a/ext/curl/config.m4 b/ext/curl/config.m4 index 9c78eb6..1af960e 100644 --- a/ext/curl/config.m4 +++ b/ext/curl/config.m4 @@ -50,35 +50,8 @@ int main(int argc, char *argv[]) } ]])],[ AC_MSG_RESULT([yes]) - AC_CHECK_HEADERS([openssl/crypto.h], [ - AC_DEFINE([HAVE_CURL_OPENSSL], [1], [Have cURL with OpenSSL support]) - ]) - ], [ - AC_MSG_RESULT([no]) - ], [ - AC_MSG_RESULT([no]) - ]) - - AC_MSG_CHECKING([for gnutls support in libcurl]) - AC_RUN_IFELSE([AC_LANG_SOURCE([[ -#include <strings.h> -#include <curl/curl.h> - -int main(int argc, char *argv[]) -{ - curl_version_info_data *data = curl_version_info(CURLVERSION_NOW); - - if (data && data->ssl_version && *data->ssl_version) { - const char *ptr = data->ssl_version; - - while(*ptr == ' ') ++ptr; - return strncasecmp(ptr, "GnuTLS", sizeof("GnuTLS")-1); - } - return 1; -} -]])], [ - AC_MSG_RESULT([yes]) - AC_DEFINE([HAVE_CURL_GNUTLS], [1], [Have cURL with GnuTLS support]) + AC_DEFINE([HAVE_CURL_OPENSSL], [1], [Have cURL with OpenSSL support]) + AC_CHECK_HEADERS([openssl/crypto.h]) ], [ AC_MSG_RESULT([no]) ], [ diff --git a/ext/curl/interface.c b/ext/curl/interface.c index 5b6e5f8..5db1be9 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -47,27 +47,17 @@ # ifdef PHP_WIN32 # define PHP_CURL_NEED_OPENSSL_TSL # include <openssl/crypto.h> -# else /* !PHP_WIN32 */ -# if defined(HAVE_CURL_OPENSSL) -# if defined(HAVE_OPENSSL_CRYPTO_H) -# define PHP_CURL_NEED_OPENSSL_TSL -# include <openssl/crypto.h> -# 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 -# elif defined(HAVE_CURL_GNUTLS) - /* Modern versions of GnuTLS use the nette backend rather than gcrypt, so there - * is nothing to do here anymore. */ +# elif defined(HAVE_CURL_OPENSSL) +# if defined(HAVE_OPENSSL_CRYPTO_H) +# define PHP_CURL_NEED_OPENSSL_TSL +# include <openssl/crypto.h> # else # warning \ - "libcurl was compiled with SSL support, but configure could not determine which" \ - "library was used; thus no SSL crypto locking callbacks will be set, which may " \ + "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 /* HAVE_CURL_OPENSSL || HAVE_CURL_GNUTLS */ -# endif /* PHP_WIN32 */ +# endif +# endif /* HAVE_CURL_OPENSSL */ #endif /* ZTS && HAVE_CURL_SSL */ /* }}} */

« previous php.cvs (#106735) next »