cURL / Mailing Lists / curl-library / Single Mail


Re: feature suggestion (with patch): callback function on http redirects

From: Jochen Kornitzky <>
Date: Mon, 16 Jan 2012 11:10:30 +0100

Hi Daniel,

On 15.01.2012 23:44, Daniel Stenberg wrote:
> In libcurl we provide a rather simple and "crude"
> follow-HTTP-redirects when enabled. This is designed to allow
> programs that just want to follow redirects in a simple-minded and
> straight forward way. It was never meant to be advanced and we have
> since day one argued that any program that needs more advanced
> redirect handling should do it themselves. For this reason we also
> implemented CURLINFO_REDIRECT_URL a few years ago.

Yes, I'm aware that my suggestion is somewhat redundant and
"advanced" from libcurl's point of view. I was looking
to reduce the application complexity with a simple hack
in libcurl. When in a curl_multi environment with many
concurrent downloads, having the redirect callback
is handy, as I can continue to use FOLLOWLOCATION (without
redirect limit) without adding my own application logic and
still be compliant with robots.txt. Reading CURLINFO_REDIRECT_URL
would be too late for that purpose as the url is already fetched
when that info is available.

Anyway, maybe the patch is useful for somebody with the same

List admin:
Received on 2012-01-16