diff --git a/NEWS b/NEWS index 8dcad6a6e847..b3db10da6c79 100644 --- a/NEWS +++ b/NEWS @@ -18,6 +18,9 @@ PHP NEWS . Fixed bug GH-15693 (Unnecessary include in main.c bloats binary). (nielsdos) +- Curl: + . The CURLOPT_DNS_USE_GLOBAL_CACHE option is now silently ignored. (Ayesh Karunaratne) + - DOM: . Fixed bug GH-13988 (Storing DOMElement consume 4 times more memory in PHP 8.1 than in PHP 8.0). (nielsdos) diff --git a/UPGRADING b/UPGRADING index 85e598ba896a..18831fdd25a9 100644 --- a/UPGRADING +++ b/UPGRADING @@ -930,6 +930,9 @@ PHP 8.4 UPGRADE NOTES - Curl: . The Curl extension now requires at least libcurl 7.61.0. + . The CURLOPT_DNS_USE_GLOBAL_CACHE Curl option no longer has any + effect, and is silently ignored. This underlying feature was + deprecated in libcurl 7.11.1 and removed in 7.62.0. - Date: . The class constants are typed now. diff --git a/ext/curl/interface.c b/ext/curl/interface.c index ba3c9667d559..3006b67dfce6 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -1165,9 +1165,6 @@ static void _php_curl_set_default_options(php_curl *ch) curl_easy_setopt(ch->cp, CURLOPT_INFILE, (void *) ch); curl_easy_setopt(ch->cp, CURLOPT_HEADERFUNCTION, curl_write_header); curl_easy_setopt(ch->cp, CURLOPT_WRITEHEADER, (void *) ch); -#ifndef ZTS - curl_easy_setopt(ch->cp, CURLOPT_DNS_USE_GLOBAL_CACHE, 1); -#endif curl_easy_setopt(ch->cp, CURLOPT_DNS_CACHE_TIMEOUT, 120); curl_easy_setopt(ch->cp, CURLOPT_MAXREDIRS, 20); /* prevent infinite redirects */ @@ -1657,7 +1654,6 @@ static zend_result _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue case CURLOPT_COOKIESESSION: case CURLOPT_CRLF: case CURLOPT_DNS_CACHE_TIMEOUT: - case CURLOPT_DNS_USE_GLOBAL_CACHE: case CURLOPT_FAILONERROR: case CURLOPT_FILETIME: case CURLOPT_FORBID_REUSE: @@ -1806,12 +1802,6 @@ static zend_result _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue php_error_docref(NULL, E_WARNING, "CURLPROTO_FILE cannot be activated when an open_basedir is set"); return FAILURE; } -# if defined(ZTS) - if (option == CURLOPT_DNS_USE_GLOBAL_CACHE && lval) { - php_error_docref(NULL, E_WARNING, "CURLOPT_DNS_USE_GLOBAL_CACHE cannot be activated when thread safety is enabled"); - return FAILURE; - } -# endif error = curl_easy_setopt(ch->cp, option, lval); break; case CURLOPT_SAFE_UPLOAD: @@ -2146,6 +2136,7 @@ static zend_result _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue } case CURLOPT_BINARYTRANSFER: + case CURLOPT_DNS_USE_GLOBAL_CACHE: /* Do nothing, just backward compatibility */ break; diff --git a/ext/curl/tests/bug71144.phpt b/ext/curl/tests/bug71144.phpt index 0c6225271d99..1684ccbbb2d1 100644 --- a/ext/curl/tests/bug71144.phpt +++ b/ext/curl/tests/bug71144.phpt @@ -1,14 +1,14 @@ --TEST-- Bug #71144 (Sementation fault when using cURL with ZTS) +--DESCRIPTION-- +Since Curl 7.62, CURLOPT_DNS_USE_GLOBAL_CACHE has no effect, and is +silently ignored. --EXTENSIONS-- curl ---SKIPIF-- - --FILE-- --EXPECTF-- -Warning: curl_setopt(): CURLOPT_DNS_USE_GLOBAL_CACHE cannot be activated when thread safety is enabled in %sbug71144.php on line %d -bool(false) +bool(true)