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 10:43:05 -0400

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...

effectiveUrl[0] is 0xf8
effectiveUrl[1] is 0x25
effectiveUrl[2] is 0xa3
effectiveUrl[3] is 0x01

The rest of the array indexes have a value of 0.

On 10/25/07, Daniel Stenberg <daniel_at_haxx.se> wrote:
>
> On Thu, 25 Oct 2007, Drew Canitz wrote:
>
> (Please don't top-post)
>
> >> curl_easy_getinfo(handle, CURLINFO_EFFECTIVE_URL, &url);
>
> > I've tried that. I seem to get garbage data.
>
> Uh, then you hit a libcurl bug or your code was wrong. Can you please show
> us
> how you did it?
>
> --
> Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
>
Received on 2007-10-25