Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upduphandle doesn't preserve CURLOPT_RESOLVE #2485
Comments
added a commit
that referenced
this issue
Apr 12, 2018
bagder
referenced this issue
Apr 12, 2018
Closed
duphandle: make sure CURLOPT_RESOLVE is duplicated fine too #2486
This comment has been minimized.
This comment has been minimized.
Thanks! My tentative fix above also adds a test for this. I think the only thing to add is to use caution with this since now both handles use the same list so you must make sure to not free the list until both are done with it! |
This comment has been minimized.
This comment has been minimized.
Right, but that caution applies in a lot of other similar cases as well, right? Like adding headers etc. So it shouldn't surprise anyone... |
This comment has been minimized.
This comment has been minimized.
Absolutely, it just struck me when I did the change and modified the test code to use this... |
This comment has been minimized.
This comment has been minimized.
Thanks! |
bagder
closed this
in
2b126cd
Apr 12, 2018
lock
bot
locked as resolved and limited conversation to collaborators
Jul 11, 2018
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
ernstp commentedApr 12, 2018
I did this
I expected the following
I expected my CURLOPT_RESOLVE to still have effect on c2. However it does not.
It's interesting that the message
"Added foo.net:80:127.0.0.1 to DNS cache"
never appears so it looks like it's neither done for the first curl handle nor c2.
Moving the setopt for RESOLVE to c2 works.
I can't really find anything in the documentation that would hint to this behaviour.
curl/libcurl version
curl 7.55.1 (x86_64-pc-linux-gnu) libcurl/7.55.1 OpenSSL/1.0.2g zlib/1.2.11 libidn2/2.0.2 libpsl/0.18.0 (+libidn2/2.0.2) librtmp/2.3
Release-Date: 2017-08-14
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP UnixSockets HTTPS-proxy PSL
operating system
Linux/Ubuntu