Req #75751 [Com]: disabling CURLOPT_DNS_USE_GLOBAL_CACHE reports a warning

From: Date: Tue, 02 Jan 2018 09:35:33 +0000
Subject: Req #75751 [Com]: disabling CURLOPT_DNS_USE_GLOBAL_CACHE reports a warning
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-213351@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75751&edit=1 ID: 75751 Comment by: spam2 at rhsoft dot net Reported by: pavel dot madr at gmail dot com Summary: disabling CURLOPT_DNS_USE_GLOBAL_CACHE reports a warning Status: Open Type: Feature/Change Request Package: cURL related Operating System: All PHP Version: 7.2.0 Block user comment: N Private report: N New Comment: > So it would be better to remove it completely from > PHP or set to FALSE be default for both modes for sure not remove it! i even wrote abugreport some months ago because a loop of requests to the same local domain triggered rate-limits of the nameserver with file_get_contents() while curl was fine and the reason is that DNS cache virtually nobody is using ZTS in production so don't sacrifice PHP because of it's existence Previous Comments: ------------------------------------------------------------------------ [2018-01-02 09:23:44] pavel dot madr at gmail dot com 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 this bug report at https://bugs.php.net/bug.php?id=75751&edit=1

« previous php.bugs (#213351) next »