curl-and-php
Re: Stopping redirects being followed from header callback
Date: Tue, 27 May 2008 23:56:05 +0200 (CEST)
On Tue, 27 May 2008, Felix Hassert wrote:
> I am looking for a way to stop libcurl following redirects. To be able to
> perform more than one request at a time I use the PHP curl_multi_exec()
> function and have CURLOPT_FOLLOWLOCATION on. But there are certain URLs that
> I don't want to load and I would like to stop the redirecting chain.
That's not supported by libcurl. Unless you set the max redir option that
limits how many redirections it should follow.
The intent has always been that if you need fancy redirect following, you
should rather do it yourself than telling libcurl to do it. This will be a lot
easier to do once 7.18.2 comes out and gets used.
> While it is possible to change other options in the header callback
It's not designed to work so even if you may be lucky to be able to change
some options like that, it may also change between versions...
-- / daniel.haxx.se _______________________________________________ http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-phpReceived on 2008-05-27