cURL / Mailing Lists / curl-library / Single Mail

curl-library

Resolved IP out of libcurl?

From: Antti Tuominen <antti.tuominen_at_hiit.fi>
Date: Fri, 8 Apr 2005 14:40:00 +0300

Hi all,

I'm developing a crawler using libcurl coupled with c-ares and I've been very
pleased with the library. A big thankyou for all the effort put to the
library! Some 400 easy handles in a single multi handle for a single
downloader runs very nicely. At best I've clocked download speeds of 160
documents per second (average speed of abt. 7 minutes) using one dual-cpu
machine.

Now I ran into a postprocessing need to have the IP from which a document was
downloaded. Or at least (one of the)IP(s) the site name resolves to. I could
of course re-resolve the name, and a local DNS cache would make it somewhat
less painful but it seems like a waste of time since libcurl has already done
it.

I looked at the source and it seems to me that adding an entry to
curl_easy_getinfo() might do the trick. In Curl_getinfo(),
data->state.connects looks promising, but then I couldn't figure out which
one of the connects I should be looking at. Is there a (single) one with
data->state.connects[i]->data == data, or are these necessarily even valid
anymore after the transfer has been completed?

Help, anyone?

-Antti

-- 
3 || 9
Received on 2005-04-08