cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: get server ip from load balanced redirect?

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Thu, 25 Oct 2007 09:07:44 -0700

On Thu, Oct 25, 2007 at 10:43:05AM -0400, Drew Canitz wrote:
> Yeah, it's possible I have a bug.
>
> After I set my URL and call curl_easy_perform and read my data in my
> CURLOPT_WRITEDATA function I call this code...
>
> char effectiveUrl[1024] = {0};
> curl_easy_getinfo( hCurl_, CURLINFO_EFFECTIVE_URL, effectiveUrl );
>
> I've tried declaring effectiveUrl as just a char* and an array. Only the array
> one seems to give any data. With the array I've tried both effectiveUrl and &
> effectiveUrl. Both of these gives the same result. My array has the first
> four characters filled with this data...

The manual says to pass in "a pointer to char *". You are passing in a
pointer to char. This command returns you a pointer to static storage that
contains the string.

>>> Dan

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