-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
dns: extend CURLOPT_RESOLVE syntax for adding non-permanent entries #6294
dns: extend CURLOPT_RESOLVE syntax for adding non-permanent entries #6294
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Also, remember to extend the docs so that users can figure out that this feature exists and how to use it!
On 10 Dec 2020, at 16:36, Daniel Stenberg ***@***.***> wrote:
I personally like amended commits and force-pushes (as long as you're the single developer in the branch) so that we can review the final result easier.
Seconded.
|
bfc3107
to
2573aa3
Compare
I've updated the PR:
Please let me know if there's anything else I should/need to do before this can be merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! One nit: I think the docs/cmdline/resolve.d
also needs an update for users of the command line tool to learn about this feature as well!
Thanks! BTW: Do you know what's up with the tests? Almost all PRs seem to be red currently. Is someone working on fixing this or is this a long-time known flakiness that you/we just live with? |
Yes and no. I'm always trying to fix flaky tests and make sure they all run green. But some are really complicated and every now and then a new one pops up. This makes it a very rare occasion that all 90-somthing CI jobs actually completes green... 😞 |
Thinking about this again, I'm not sure it would make sense to add that to the curl command line documentation. Our case is different, because we use libcurl in a tool that's long running but wants to create the initial connection as quickly as possible -- and we already have the resolved IPs at the time we do the first libcurl transfer. So for libcurl it IMO makes a lot of sense. But for the command line tool, I think it may hurt more than help (by creating confusion -- why is this option there/what is it good for?). Let me know what you think. |
Regarding the syntax, would something like ,timeout be easier to understand: |
@jay
And regarding the 60 in "timeout:60": that would require more modifications because libcurl currently only supports one timeout for all DNS cache entries. So IMO adding the option as it's implemented now is a good solution. I think the syntax is OK and I would not want to change the PR again (for obvious reasons :)). |
I think it should be, because the command line tool passes the data into the same option so it does use he same format, even if I agree that for command line users it might very rarely actually be a useful and wanted feature. |
Extend the syntax of CURLOPT_RESOLVE strings: allow using a '+' prefix (similar to the existing '-' prefix for removing entries) to add DNS cache entries that will time out just like entries that are added by libcurl itself. Append " (non-permanent)" to info log message in case a non-permanent entry is added. Adjust relevant comments to reflect the new behavior. Adjust documentation. Extend unit1607 to test the new functionality.
2573aa3
to
282295a
Compare
@bagder I've added the change for the command line documentation. I've had a quick look at the code of the command line utility + also the source generated with However after some googling/reading the documentation I'm not even sure this will have an effect in parallel mode. I'd have to add some debug output to the code and run some tests to make sure. So again, I think we should not add this the the command line documentation. The best case scenario we can achieve with it is to not confuse people by describing an option that they will never need. But I'll leave the decision up to you. Again, please let me know if I have to do/change anything before this can be merged. |
The I totally agree with you that it takes a rather convoluted example to come up with a way for a user to actually want to use this, but I don't think that's reason enough to not document a function that is accessible. |
As I said, I think it will harm more by confusing people than help. But if you want to add it, that's fine. As I said I've updated the PR. Can this be merged in its current form or do you want me to change anything? |
Thanks! |
Can this option be applied to CURL-multi handle? So that each easy handle added to CURLM use it forcibly? PS. Sorry for dumb question. Documentation for CURLOPT_RESOLVE option doesn't explicitly allows or forbids this use case. |
The At that time libcurl will determine which DNS cache object to use. Once the DNS cache object has been determined, the So... long story short: you can not use Phew. I hope this description is accurate and actually understandable. |
Extend the syntax of CURLOPT_RESOLVE strings: allow using a '+' prefix
(similar to the existing '-' prefix for removing entries) to add
DNS cache entries that will time out just like entries that are added
by libcurl itself.
Append " (non-permanent)" to info log message in case a non-permanent
entry is added.
Adjust relevant comments to reflect the new behavior.
Adjust documentation.
Extend unit1607 to test the new functionality.