cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: --proxy-ntlm and --fail

From: David Byron <DByron_at_everdreamcorp.com>
Date: Fri, 26 Mar 2004 15:46:04 -0800

On Wed, 17 Mar 2004, Daniel Stenberg wrote:

> I think the code is still complicated and this problem is
> still tricky to solve. If --fail is set and we get a HTTP
> response code > 400, we probably need to check if we're
> using an multi-pass authentication method and if we're
> talking with a proxy or a host, and based on that knowledge
> decide if the http response code is bad or not.

I'm starting to look at this again and I'm curious if I'm on the right
track. This is what I'd like to do:

- replace the code around line 581 of transfer.c that checks if k->httpcode
>= 400 with a function called something like
http_is_terminal_code(conn,k->httpcode).

- implement http_is_terminal_code in http.c

- part of http_is_terminal_code is easy. It's only when the code is 401 or
407 that it's a bit complicated.

Right now, it looks like this function will get called before
Curl_http_auth_act. If this is true (and remains true), I think the only
info I have to use in http_is_terminal_code is conn->data->set.httpauth and
proxyauth. Unfortunately, I don't think that's right, or maybe not enough.
Seems like I want to use authstage and authwant but from what I can tell,
they're set up in Curl_http_auth_act and Curl_http_auth which right now are
called after the httpcode is checked.

Is it OK to just use httpauth and proxyauth? Do I need to use the other
info? Am I close?

Thanks much.

-DB
Received on 2004-03-27