cURL / Mailing Lists / curl-library / Single Mail

curl-library

re: "libcurl & ip addresses" (fwd)

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Thu, 6 Jan 2005 17:29:16 +0100 (CET)

Forwarding a suggestion from "Alan".

-- 
      Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
       Dedicated custom curl help for hire: http://haxx.se/curl.html
---------- Forwarded message ----------
Date: 6 Jan 2005 16:07:40 -0000
From: Alan
To: daniel_at_haxx.se
Subject: re: "libcurl & ip addresses"
I also could use this feature for logging purposes. A simple suggestion:
Add to curl_easy_getinfo the following:
GET_HTTP_IP
GET_FTP_IP
GET_FTP_DATA_IP
--
pass in a char**
return 0 if connection is not open else return allocated string with ip.
I only suggest a string to deal with ipv4 vs ipv6.
Alternatively it would be nice if you could get the sock from curl_easy then
I could look up the ip that way via getpeername. I see multi might do this but
seems excessive to use multi just to get the ip for logging purposes.
Thanks,
Alan
--
You wrote:
> I'm using libcurl with perl. After I tell libcurl to fetch a file, is there
> a way to get libcurl to tell me the IP address of the domain it
> communicated with?
No, there is no such feature in the current libcurl.
Feel free to suggest how one could be added. Do keep in mind that IP is not
IPv4 only and that FTP can talk to more than one IP...
---
Received on 2005-01-06