cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Unable to get HTTP Status 407 when using libcurl with proxy a nd https

From: Lance Munslow <lance.munslow_at_ttsltd.com>
Date: Mon, 11 Aug 2003 13:39:01 +0100

Hi Daniel,

        Id the following suitable?

*** old/urldata.h Mon Aug 11 13:29:57 2003
--- new/urldata.h Mon Aug 11 13:30:49 2003
***************
*** 548,551 ****
--- 548,552 ----
  struct PureInfo {
    int httpcode;
+ int httpproxycode;
    int httpversion;
    time_t filetime; /* If requested, this is might get set. Set to -1 if
*** old/http.c Mon Aug 11 13:29:57 2003
--- new/http.c Mon Aug 11 13:30:42 2003
***************
*** 545,548 ****
--- 545,550 ----
      return CURLE_RECV_ERROR;
  
+ data->info.httpproxycode = httperror;
+
    if(200 != httperror) {
      if(407 == httperror)
*** old/curl.h Mon Aug 11 13:29:18 2003
--- new/curl.h Mon Aug 11 13:30:20 2003
***************
*** 999,1004 ****
  
    /* Fill in new entries here! */
  
! CURLINFO_LASTONE = 22
  } CURLINFO;
  
--- 999,1005 ----
  
    /* Fill in new entries here! */
+ CURLINFO_HTTP_PROXYCODE = CURLINFO_LONG + 22,
  
! CURLINFO_LASTONE = 23
  } CURLINFO;
  
*** old/getinfo.c Mon Aug 11 13:29:57 2003
--- new/getinfo.c Mon Aug 11 13:30:42 2003
***************
*** 107,110 ****
--- 107,113 ----
      *param_longp = data->info.httpcode;
      break;
+ case CURLINFO_HTTP_PROXYCODE:
+ *param_longp = data->info.httpproxycode;
+ break;
    case CURLINFO_FILETIME:
      *param_longp = data->info.filetime;

regards,

Lance Munslow
Software Development
Travel Technology Systems Ltd

This Email may contain information of a confidential and/or privileged
nature.
The information transmitted is intended only for the benefit of the person
or entity to which it is addressed and must not be copied or forwarded
without the sender's express permission.
This Email does not reflect the views or opinions of Travel Technology
Systems Ltd.
This Email is without prejudice.
This Email does not constitute an agreement either explicitly or implicitly
with Travel Technology Systems Ltd.

-----Original Message-----
From: Daniel Stenberg [mailto:daniel_at_haxx.se]
Sent: 08 August 2003 18:18
To: libcurl Mailing list
Subject: Re: Unable to get HTTP Status 407 when using libcurl with proxy
and h ttps

On Fri, 8 Aug 2003, Lance Munslow wrote:

> When using a proxy and HTTPS the Curl_ConnectHTTPProxyTunnel() func is
> called within Curl_http_connect(). When I provide invalid auth details
the
> 407 generated reaches here in ConnectHTTPProxyTunnel():
>
> if(200 != httperror) {
> if(407 == httperror)
> /* Added Nov 6 1998 */
> failf(data, "Proxy requires authorization!");
> else
> failf(data, "Received error code %d from proxy", httperror);
> return CURLE_RECV_ERROR;
> }
>
> How can I get at the 407 from the proxy?
>
> Using:
> curl_easy_getinfo(m_curl, CURLINFO_HTTP_CODE, ...)
> returns 0.
>
> When not using HTTPS ConnectHTTPProxyTunnel() is not called and
everything's
> as expected.
>
> Any help is appreciated.

This is a bug that should be fixed.

Can you make a fix for this and mail us the diff?

I figure a proper fix would introduce a new info variable, separately from
the
HTTP_CODE one, letting that one continue to work for the remote server's
reply
only.

-- 
 Daniel Stenberg -- curl: been grokking URLs since 1998
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
Received on 2003-08-11