Req #75751 [NEW]: disabling CURLOPT_DNS_USE_GLOBAL_CACHE reports a warning
| From: | pavel dot madr at gmail dot com | Date: | Tue, 02 Jan 2018 09:23:47 +0000 |
| Subject: | Req #75751 [NEW]: disabling CURLOPT_DNS_USE_GLOBAL_CACHE reports a warning | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-213350@lists.php.net to get a copy of this message | ||
From: pavel dot madr at gmail dot com
Operating system: All
PHP version: 7.2.0
Package: cURL related
Bug Type: Feature/Change Request
Bug description:disabling CURLOPT_DNS_USE_GLOBAL_CACHE reports a warning
Description:
------------
This line of code produces warning in PHP compiled with ZTS.
$c = curl_init();
curl_setopt($c, CURLOPT_DNS_USE_GLOBAL_CACHE, false);
It's perfectly ok to call this method with false argument and no warning
should appear. The warning should appear only when true is used for the
argument:
curl_setopt($c, CURLOPT_DNS_USE_GLOBAL_CACHE, true);
Also the documentation is not exact - "This option is not thread-safe
and is enabled by default."
CURLOPT_DNS_USE_GLOBAL_CACHE is FALSE by default in ZTS mode and TRUE in
non-ZTS mode.
According to the cUrl documentation this flag should not be used.
https://curl.haxx.se/libcurl/c/CURLOPT_DNS_USE_GLOBAL_CACHE.html
So it would be better to remove it completely from PHP or set to FALSE
be default for both modes.
The attached patch solves just appearance of the warning.
--
Edit bug report at https://bugs.php.net/bug.php?id=75751&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=75751&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=75751&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=75751&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=75751&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=75751&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=75751&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=75751&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=75751&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=75751&r=support
Expected behavior: https://bugs.php.net/fix.php?id=75751&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=75751&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=75751&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=75751&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75751&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=75751&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=75751&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=75751&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=75751&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=75751&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=75751&r=mysqlcfg