summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Wallner <mike@php.net>2006-12-19 21:41:25 +0000
committerMichael Wallner <mike@php.net>2006-12-19 21:41:25 +0000
commit2beee146b407184258ae32fb0967e129a0b00098 (patch)
tree6fa0c6982dd713acf49a10e3e5e42535ee96cd88
parent1ef3ca7bf7d22c6b98111ce0e0fbc694daa5359f (diff)
downloadphp-git-2beee146b407184258ae32fb0967e129a0b00098.tar.gz
MFH: check CRYPTO_get_id_callback() if anyone else already set thread lock callbacks
-rw-r--r--ext/curl/interface.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/ext/curl/interface.c b/ext/curl/interface.c
index 637d7d51ec..54e5f46e2c 100644
--- a/ext/curl/interface.c
+++ b/ext/curl/interface.c
@@ -614,7 +614,7 @@ PHP_MINIT_FUNCTION(curl)
#endif
#ifdef PHP_CURL_NEED_OPENSSL_TSL
- {
+ if (!CRYPTO_get_id_callback()) {
int i, c = CRYPTO_num_locks();
php_curl_openssl_tsl = malloc(c * sizeof(MUTEX_T));
@@ -667,16 +667,11 @@ PHP_MSHUTDOWN_FUNCTION(curl)
php_unregister_url_stream_wrapper("ftp" TSRMLS_CC);
php_unregister_url_stream_wrapper("ldap" TSRMLS_CC);
#endif
-#ifdef PHP_CURL_NEED_OPENSSL_TSL
- /* ensure there are valid callbacks set */
- CRYPTO_set_id_callback(php_curl_ssl_id);
- CRYPTO_set_locking_callback(php_curl_ssl_lock);
-#endif
curl_global_cleanup();
#ifdef PHP_CURL_NEED_OPENSSL_TSL
if (php_curl_openssl_tsl) {
int i, c = CRYPTO_num_locks();
-
+
CRYPTO_set_id_callback(NULL);
CRYPTO_set_locking_callback(NULL);