cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: get server ip from load balanced redirect?

From: Drew Canitz <drewcanitz_at_gmail.com>
Date: Thu, 25 Oct 2007 14:41:56 -0400

When I change my code to this...

char *effectiveUrl = NULL;
curl_easy_getinfo( hCurl_, CURLINFO_EFFECTIVE_URL, &effectiveUrl );

My data is now...

effectiveUrl[0] is 0xee
effectiveUrl[1] is 0xfe
effectiveUrl[2] is 0xee
effectiveUrl[3] is 0xfe

...and so on. Still not the server address or IP.
On 10/25/07, Dan Fandrich <dan_at_coneharvesters.com> wrote:
>
> 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