cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Patch for 301/302 redirect after post

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 12 Aug 2008 13:09:47 +0200 (CEST)

On Tue, 12 Aug 2008, Martin Drasar wrote:

> Here's the complete patch with src/main.c fixed.

If you're going for gold points, you could look into adding a test case as
well that verifies this feature.

BTW, the patch isn't correct:

+ data->set.post301 = (CURL_REDIR_GET_ALL != va_arg(param, long)) &&
+ (CURL_REDIR_POST_302 != va_arg(param, long));
+ data->set.post302 = (CURL_REDIR_GET_ALL != va_arg(param, long)) &&
+ (CURL_REDIR_POST_301 != va_arg(param, long));

va_arg() pops an argument from the stack, so you cannot call it multiple times
like this and rely on it. It needs to be done once to pull the single
argument.

-- 
  / daniel.haxx.se
Received on 2008-08-12