com php-src: Remove curl gnutls locking: ext/curl/config.m4 ext/curl/interface.c
| From: | Nikita Popov | Date: | Thu, 11 Apr 2019 14:45:45 +0000 |
| Subject: | com php-src: Remove curl gnutls locking: ext/curl/config.m4 ext/curl/interface.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-105668@lists.php.net to get a copy of this message | ||
Commit: 3e0f9c2c94d1511eaf30f8f1de8260f5821c985f
Author: Nikita Popov <nikita.ppv@gmail.com> Thu, 11 Apr 2019 16:45:45 +0200
Parents: 9d663cba1abed1697dce5f73a7177ad2d7beaeb7
Branches: PHP-7.4 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3e0f9c2c94d1511eaf30f8f1de8260f5821c985f
Log:
Remove curl gnutls locking
This is only relevant for the gcrypt backend, which is no longer in
use. I couldn't find any hard info on when exactly gcrypt support was
dropped, but nette is the default since 2.11.1. Most code that still
has the gcrypt handling is checking against < 2.12. In either case,
those versions were released in 2010/2011.
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 6ebfac7..88447bd 100644
--- a/ext/curl/config.m4
+++ b/ext/curl/config.m4
@@ -80,9 +80,7 @@ int main(int argc, char *argv[])
}
]])], [
AC_MSG_RESULT([yes])
- AC_CHECK_HEADER([gcrypt.h], [
- AC_DEFINE([HAVE_CURL_GNUTLS], [1], [Have cURL with GnuTLS support])
- ])
+ AC_DEFINE([HAVE_CURL_GNUTLS], [1], [Have cURL with GnuTLS support])
], [
AC_MSG_RESULT([no])
], [
diff --git a/ext/curl/interface.c b/ext/curl/interface.c
index 8959bc1..f074cba 100644
--- a/ext/curl/interface.c
+++ b/ext/curl/interface.c
@@ -59,15 +59,8 @@
"cause random crashes on SSL requests"
# endif
# elif defined(HAVE_CURL_GNUTLS)
-# if defined(HAVE_GCRYPT_H)
-# define PHP_CURL_NEED_GNUTLS_TSL
-# include <gcrypt.h>
-# else
-# warning \
- "libcurl was compiled with GnuTLS support, but configure could not find " \
- "gcrypt.h; thus no SSL crypto locking callbacks will be set, which may " \
- "cause random crashes on SSL requests"
-# endif
+ /* Modern versions of GnuTLS use the nette backend rather than gcrypt, so there
+ * is nothing to do here anymore. */
# else
# warning \
"libcurl was compiled with SSL support, but configure could not determine which" \
@@ -111,43 +104,6 @@ static ZEND_ATTRIBUTE_UNUSED unsigned long php_curl_ssl_id(void)
#endif
/* }}} */
-#ifdef PHP_CURL_NEED_GNUTLS_TSL /* {{{ */
-static int php_curl_ssl_mutex_create(void **m)
-{
- if (*((MUTEX_T *) m) = tsrm_mutex_alloc()) {
- return SUCCESS;
- } else {
- return FAILURE;
- }
-}
-
-static int php_curl_ssl_mutex_destroy(void **m)
-{
- tsrm_mutex_free(*((MUTEX_T *) m));
- return SUCCESS;
-}
-
-static int php_curl_ssl_mutex_lock(void **m)
-{
- return tsrm_mutex_lock(*((MUTEX_T *) m));
-}
-
-static int php_curl_ssl_mutex_unlock(void **m)
-{
- return tsrm_mutex_unlock(*((MUTEX_T *) m));
-}
-
-static struct gcry_thread_cbs php_curl_gnutls_tsl = {
- GCRY_THREAD_OPTION_USER,
- NULL,
- php_curl_ssl_mutex_create,
- php_curl_ssl_mutex_destroy,
- php_curl_ssl_mutex_lock,
- php_curl_ssl_mutex_unlock
-};
-#endif
-/* }}} */
-
static void _php_curl_close_ex(php_curl *ch);
static void _php_curl_close(zend_resource *rsrc);
@@ -1473,9 +1429,6 @@ PHP_MINIT_FUNCTION(curl)
CRYPTO_set_locking_callback(php_curl_ssl_lock);
}
#endif
-#ifdef PHP_CURL_NEED_GNUTLS_TSL
- gcry_control(GCRYCTL_SET_THREAD_CBS, &php_curl_gnutls_tsl);
-#endif
if (curl_global_init(CURL_GLOBAL_DEFAULT) != CURLE_OK) {
return FAILURE;