cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Cannot resolve localhost or 127.0.0.1

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Fri, 11 Jan 2008 11:39:21 -0800

On Fri, Jan 11, 2008 at 11:17:45AM -0800, weiping guo wrote:
> Sorry, my bad. My original code looks like this.
>
> char url[REQUEST_LEN*2];
> memset(url,0, REQUEST_LEN*2);
> int n = sprintf(url, "http://%s:%d/%s?%s", this->ip_, this->port_, this->url_, request);
>
> It seems that curl is trying to cache the DNS entry. For the first time to call this function, it always return an error. Subsequent calls never fail.

If you are passing in IP addresses directly, there's nothing to cache.
Have you tried logging the URL you pass in to curl each time to make sure
that it's what you expect each time through?

And this is really a libcurl question that is better handled on the libcurl
mailinglist.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2008-01-11