curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: IP address of failed/tried connections?

From: Ray Satiro via curl-library <curl-library_at_cool.haxx.se>
Date: Thu, 2 Jan 2020 00:51:47 -0500

On 1/2/2020 12:34 AM, Ray Satiro wrote:
> libcurl saves that information only if a connection is made [1]. You
> may not be looking for debug strings but CURLINFO_TEXT is the fastest
> way I can think of to do what you're asking [2][3][4][5]. Either that
> or you modify libcurl for your own purposes to do it. (I don't think
> there's any interest to add such a feature upstream, but I'm sure I'll
> be shortly corrected if there is).

hm I'm a little scattered today, I just thought of
CURLOPT_OPENSOCKETFUNCTION [1] and CURLOPT_SOCKOPTFUNCTION [2]. You
could record the addresses on open and then use primary_ip to see which
one curl is using for the transfer. Also you could choose on open to do
the connection yourself and return CURL_SOCKOPT_ALREADY_CONNECTED if you
need that type information, such as you need to know always whether a
connection succeeded or not (remember libcurl may discard a successful
connection if another connection beat it due to happy eyeballs).

[1]: https://curl.haxx.se/libcurl/c/CURLOPT_OPENSOCKETFUNCTION.html
[2]: https://curl.haxx.se/libcurl/c/CURLOPT_SOCKOPTFUNCTION.html

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2020-01-02