curl-library
feature suggestion (with patch): callback function on http redirects
Date: Sun, 15 Jan 2012 13:12:46 +0100
Hi,
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,
korni
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
- text/x-patch attachment: curl-redirect-7.23.1.patch