Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
CURLOPT_RESOLVE multiple ips and CURLOPT_HAPPY_EYEBALLS_TIMEOUT #2260
This pull request enables two things:
This enables platforms that do their own resolving to still take advantage of happy eyeballs and connecting to the next ip address in the list if the first one doesn't connect within a reasonable timeout.
@jay I've updated the pull request with upstream changes that made the fnmatch stuff work again so I think it's all good to go now. I squashed it into one commit so the tests will take some hours. Let me know if you have other things you want changed. We would love to see this in the next version of Curl :-)
On refresh just now I only see 1 file in the review, can you check again on that. This PR contains two distinct changes and I'd prefer them as separate commits if possible. Also one thing I saw before I refreshed was camelCase variable names which we don't use and although we technically don't have any guidance against it I suggest changing them.
That's likely if all feedback is addressed.
edit: now working on the 2nd review in https://github.com/curl/curl/compare/master...jay:pr_2260_mod1?expand=1
Feb 1, 2018
No it's fine. I started a final review of the curlopt_resolve changes several days ago, I edited my post to reflect that and also since I ref tagged it it shows each time I update the commit but I guess since it's not the branch associated with the pr it doesn't send out a ping. I made some minor changes to the loop, of note is some consolidation
Concerning the happy eyeballs timeout change I looked at it again just now and I still don't like that a timeout of 0 will reset it to the default. Also maybe it's not a good idea to specify that 200 is the default since we may want to change it in the future. Perhaps a new macro like CURLHETOPT_DEFAULT_TIMEOUT that is set (long)-1 that way we know what is set. I am thinking about anyone who reads through the code and they see
curl_easy_setopt(curl, CURLOPT_HAPPY_EYEBALLS_TIMEOUT, 0);
which one of those best signals to the reader that they caller wants the default value
go for it. CURLHETOPT_DEFAULT_TIMEOUT seems like a good name unless you can think of something better. the first part as CURLHETOPT because I know there is CURLSSLOPT for CURLOPT_SSL_OPTIONS option symbols so I was trying to mimic that. looking at the symbols-in-versions I don't see a clear winner for abbreviation format maybe CURL_HET_DEFAULT_TIMEOUT? CURL_HAPPY_EYEBALLS_DEFAULT_TIMEOUT seems like a mouthful. @bagder any ideas