cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: http state 407 not in curl_easy_getinfo()

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 12 May 2003 14:29:44 +0200 (CEST)

On Mon, 12 May 2003, Jörg Müller-Tolk wrote:

> I am using Curl-7.9.6 .

That is very old. I'd advice you to upgrade.

> When using a proxy which requires authorization Curl correctly sets the
> error message to "Proxy requires authorization".
> curl_easy_getinfo(curl, CURLINFO_HTTP_CODE, &httpState);
> But httpState is zero and not 407.

CURLINFO_HTTP_CODE is the HTTP code of the remote server. When the proxy
itself returns failure (as in this case), you never reached the remote server
and thus you won't get the remote server's HTTP error code.

Yes, the proxy returns HTTP error codes too, but I think it would be very
confusing if libcurl in this case would decide to extract and return the code
from the proxy connection and not from the remote server.

> What can I do to see the 407?

Hm. I don't think we have any way of accessing this. Would you say a
CURLINFO_PROXY_HTTP_CODE (or similar) would fit?

-- 
 Daniel Stenberg -- curl: been grokking URLs since 1998
-------------------------------------------------------
Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara
The only event dedicated to issues related to Linux enterprise solutions
www.enterpriselinuxforum.com
Received on 2003-05-12