cURL / Mailing Lists / curl-library / Single Mail

curl-library

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

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 16 Jan 2012 15:01:40 +0100 (CET)

On Mon, 16 Jan 2012, Jochen Kornitzky wrote:

> I was looking to reduce the application complexity with a simple hack in
> libcurl.

Right. Adding complexity in libcurl rather than adding the logic in the
application. I don't quite see why it is simpler in libcurl than in the app
though.

> Reading CURLINFO_REDIRECT_URL would be too late for that purpose as the url
> is already fetched when that info is available.

Why is that too late? There won't be any difference in how much data that is
downloaded and connections will be re-used to the exact same extent...

Note also that you call the callback a bit early so your callback won't get
the same absolute URL CURLINFO_REDIRECT_URL does.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2012-01-16