Bug #69047 [Com]: CURLOPT_IPRESOLVE change for next curl_exec has no effect

From: Date: Thu, 12 Feb 2015 22:57:18 +0000
Subject: Bug #69047 [Com]: CURLOPT_IPRESOLVE change for next curl_exec has no effect
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-190642@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69047&edit=1 ID: 69047 Comment by: vali2015 at validom dot de Reported by: vali2015 at validom dot de Summary: CURLOPT_IPRESOLVE change for next curl_exec has no effect Status: Not a bug Type: Bug Package: cURL related Operating System: Debian PHP Version: 5.4.37 Block user comment: N Private report: N New Comment: This solves it, thanks so much! Previous Comments: ------------------------------------------------------------------------ [2015-02-12 22:52:34] requinix@php.net The cURL library caches hostname lookups (in additional to reusing connections). You can disable it globally with CURLOPT_DNS_USE_GLOBAL_CACHE=false (default true), or individually set CURLOPT_DNS_CACHE_TIMEOUT=0 (default two minutes) for the cache entry to expire when you close the connection. ------------------------------------------------------------------------ [2015-02-12 22:15:19] vali2015 at validom dot de Description: ------------ When using multiple curl_exec calls but using different CURLOPT_IPRESOLVE settings, the first setting takes effect regardless of what you set in the next calls. Test script: --------------- Precondition: two hosts with IPv4 AND IPv6. Place the script returning your remote address on one server and the test-script on the other. Execute the test-script. Code: http://pastebin.com/M1tfCtuq The test-script eliminates cache-issues on both servers by using random additions to the URL fetched Expected result: ---------------- CURLOPT_IPRESOLVE should take effect on each call, especially in combination with CURLOPT_FRESH_CONNECT Actual result: -------------- there is always the connection-type used which was used for the first connect ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=69047&edit=1

« previous php.bugs (#190642) next »