cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Re: IP addresses of redirected servers

From: <binziwang_at_gmail.com>
Date: Tue, 22 Feb 2011 22:28:04 +0000

Dirk and Daniel,

Thanks a lot for your suggestions.

Our application has been relying on libcurl for URL redirection. We would
need to rewrite a large portion of the code to handle URL redirection
manually.

Daniel, do you see a problem with extending libcurl in either of the
approach I suggested? I don't really mean: "I don't want to change my code,
so I will just mess around with libcurl". It is just that the extension to
libcurl seems pretty simple. So I suggested it.

Bin

On Feb 22, 2011 1:14pm, Daniel Stenberg <daniel_at_haxx.se> wrote:
> On Tue, 22 Feb 2011, Bin Wang wrote:

> We use libcurl with CURLOPT_FOLLOWLOCATION option turned on. We have a
> need to obtain the IP addresses of all the servers libcurl tries to
> connect along the whole redirection process.

> Since libcurl currently does not provide this, I am thinking about
> extending libcurl. I can think of two approaches of doing this:

> Allow me to offer yet another way to solve your problem:

> 1. Don't enable CURLOPT_FOLLOWLOCATION

> 2. Use curl_easy_getinfo's CURLINFO_PRIMARY_IP to get the IP

> 3. Use curl_easy_getinfo's CURLINFO_REDIRECT_URL to extract redirect URLs
> and redirect there "manually".

> --

> / daniel.haxx.se

> -------------------------------------------------------------------

> List admin: http://cool.haxx.se/list/listinfo/curl-library

> Etiquette: http://curl.haxx.se/mail/etiquette.html

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-02-22