curl-library
Re: Patch for 301/302 redirect after post
Date: Thu, 7 Aug 2008 14:16:50 -0700
On Thu, Aug 07, 2008 at 10:50:09AM +0200, Martin Drasar wrote:
> I don't know if I have renamed the POST301 option correctly, i.e. is
> using CINIT with different name but same number what you call renaming?
There's a section in curl.h starting #ifndef CURL_NO_OLDIES that contains
other renamed options. CURLOPT_POST301 should go in there, which lets
users test that their apps aren't using any outdated options by setting
CURL_NO_OLDIES.
> I have tried to keep the spirit of "non-zero turns it on", but for
> obvious reasons, anyone who use 2 as a setting value for CURLOPT_POST301
> will not get it working as he/she wanted.
These values also work as bit fields, so POST_301|POST_302 == POST_ALL
It might be worthwhile documenting them as such.
> As for the magic names - I was too scared to try to insert them into some
> file, so it will probably up to you :-)
Just create an enum similar to the one for CURLOPT_HTTP_VERSION and put it
in the same section of the file.
> My suggestion:
> either
> 0 = 301_GET_302_GET
> 1 = 301_POST_302_GET
> 2 = 301_GET_302_POST
> 3 = 301_POST_302_POST
> or
> 0 = GET_ALL
> 1 = POST_301
> 2 = POST_302
> 3 = POST_ALL
> and maybe some prefixes or suffixes ;-)
These should have at least a CURL_ prefix, maybe CURL_REDIR_POST_301 etc.
>>> Dan
-- http://www.MoveAnnouncer.com The web change of address service Let webmasters know that your web site has movedReceived on 2008-08-07