Skip to content

ext/curl: No-op CURLOPT_DNS_USE_GLOBAL_CACHE constant #15127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

Ayesh
Copy link
Member

@Ayesh Ayesh commented Jul 27, 2024

Libcurl CURLOPT_DNS_USE_GLOBAL_CACHE constant is no longer supported since libcurl1 7.62. This feature is also not thread-safe, and we have special handling to emit warnings if it's used in ZTS builds.

Impact: Close to 1,100 hits on GitHub code search2

Libcurl CURLOPT_DNS_USE_GLOBAL_CACHE constant is no longer supported since libcurl1 7.62. This no-ops the constant, but without causing any deprecation notices.

Footnotes

  1. CURLOPT_DNS_USE_GLOBAL_CACHE 2

  2. GitHub code search: CURLOPT_DNS_USE_GLOBAL_CACHE

@devnexen
Copy link
Member

Makes sense, note that centos 8 (the future centos minimum supported), curl version is 7.61.1 though.

@Ayesh
Copy link
Member Author

Ayesh commented Jul 27, 2024

You are right I was concerned about CentOS/RHEL 8 usage too. Perhaps we can no-op it without a deprecation notice, and then deprecate it in a future version?

@devnexen
Copy link
Member

Maybe you can gather some opinions on the mailing list ?

@Ayesh Ayesh force-pushed the curl-deprecate-CURLOPT_DNS_USE_GLOBAL_CACHE branch from edc432b to dfd1cd0 Compare July 29, 2024 11:36
@Ayesh Ayesh changed the title ext/curl: Deprecate CURLOPT_DNS_USE_GLOBAL_CACHE constant ext/curl: No-op CURLOPT_DNS_USE_GLOBAL_CACHE constant Jul 29, 2024
Copy link
Member

@cmb69 cmb69 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Comment on lines 79 to 78
const CURLOPT_DNS_USE_GLOBAL_CACHE = UNKNOWN;
const CURLOPT_DNS_USE_GLOBAL_CACHE = -1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this to suppress a deprecation warning when building ext/curl against recent libcurl versions, or just a convention?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah. just seen #5094 (comment), so this is probably a good idea.

@Ayesh Ayesh force-pushed the curl-deprecate-CURLOPT_DNS_USE_GLOBAL_CACHE branch from dfd1cd0 to 694dfe1 Compare July 30, 2024 06:51
Copy link
Member Author

@Ayesh Ayesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently, CURLOPT_SAFE_UPLOAD has the value -1, so I reverted the previous change that set the CURLOPT_DNS_USE_GLOBAL_CACHE value to -1.

@cmb69
Copy link
Member

cmb69 commented Jul 30, 2024

Apparently, CURLOPT_SAFE_UPLOAD has the value -1, so I reverted the previous change that set the CURLOPT_DNS_USE_GLOBAL_CACHE value to -1.

Indeed, that appears to be best for now.

Copy link
Member

@cmb69 cmb69 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me.

@Ayesh Ayesh force-pushed the curl-deprecate-CURLOPT_DNS_USE_GLOBAL_CACHE branch from 694dfe1 to 40eb288 Compare September 4, 2024 09:46
@Ayesh
Copy link
Member Author

Ayesh commented Sep 4, 2024

Friendly gentle ping to see we can go forward with this :)

I emailed internals last month. It didn't receive a lot of responses, but there were no objections about changing this to no-op the constant. We can perhaps deprecate this in a future PHP version, hopefully as part of a bigger change to brush up all deprecated/obsolete options.

Libcurl `CURLOPT_DNS_USE_GLOBAL_CACHE` constant is no longer supported
since libcurl[^1] 7.62. This no-ops the constant, but without causing
any deprecation notices.

[^1]: [CURLOPT_DNS_USE_GLOBAL_CACHE](https://curl.se/libcurl/c/CURLOPT_DNS_USE_GLOBAL_CACHE.html)
@Ayesh Ayesh force-pushed the curl-deprecate-CURLOPT_DNS_USE_GLOBAL_CACHE branch from 40eb288 to 422255d Compare September 4, 2024 09:52
@cmb69 cmb69 merged commit 24d4ae9 into php:master Sep 4, 2024
10 checks passed
@cmb69
Copy link
Member

cmb69 commented Sep 4, 2024

Thank you!

Ayesh added a commit to Ayesh/doc-en that referenced this pull request Nov 14, 2024
Commit: php/php-src#15127
PHP.Watch: [PHP 8.4: Curl: `CURLOPT_DNS_USE_GLOBAL_CACHE` no longer has any effect](https://php.watch/versions/8.4/CURLOPT_DNS_USE_GLOBAL_CACHE-no-op)
Ayesh added a commit to Ayesh/doc-en that referenced this pull request Nov 15, 2024
Commit: php/php-src#15127
PHP.Watch: [PHP 8.4: Curl: `CURLOPT_DNS_USE_GLOBAL_CACHE` no longer has any effect](https://php.watch/versions/8.4/CURLOPT_DNS_USE_GLOBAL_CACHE-no-op)
Ayesh added a commit to Ayesh/doc-en that referenced this pull request Nov 15, 2024
Commit: php/php-src#15127
PHP.Watch: [PHP 8.4: Curl: `CURLOPT_DNS_USE_GLOBAL_CACHE` no longer has any effect](https://php.watch/versions/8.4/CURLOPT_DNS_USE_GLOBAL_CACHE-no-op)
Ayesh added a commit to Ayesh/doc-en that referenced this pull request Nov 16, 2024
Commit: php/php-src#15127
PHP.Watch: [PHP 8.4: Curl: `CURLOPT_DNS_USE_GLOBAL_CACHE` no longer has any effect](https://php.watch/versions/8.4/CURLOPT_DNS_USE_GLOBAL_CACHE-no-op)
Girgias pushed a commit to php/doc-en that referenced this pull request Nov 16, 2024
Commit: php/php-src#15127
PHP.Watch: [PHP 8.4: Curl: `CURLOPT_DNS_USE_GLOBAL_CACHE` no longer has any effect](https://php.watch/versions/8.4/CURLOPT_DNS_USE_GLOBAL_CACHE-no-op)
@Ayesh Ayesh deleted the curl-deprecate-CURLOPT_DNS_USE_GLOBAL_CACHE branch November 25, 2024 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants