cURL / Mailing Lists / curl-library / Single Mail


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

From: Jochen Kornitzky <>
Date: Sun, 15 Jan 2012 13:12:46 +0100


you may want to consider the attached patch implementing a callback
function in libcurl to be called when a http redirect (enabled by
CURLOPT_FOLLOWLOCATION) is about to be followed. The callback
function is called with the URL to be opened and may abort the
redirect by returning an error code.

I use that (from PHP) in web spider code to evaluate robots.txt
exclusions while in a chain of redirects that become more and more
common by the use of URL shorteners. The PHP integration needs
an opaque data pointer to give the (PHP) callback function the
required context.

I hope I met the the cURL standards with the submission,


List admin:

Received on 2012-01-15