cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Proxy authentication with CONNECT_ONLY option.

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 4 Jul 2006 13:16:03 +0200 (CEST)

On Tue, 4 Jul 2006, Praks wrote:

> I am trying to develop a sample HTTP client application on Cygwin using
> curl-7.15.3.
>
> I have used CONNECT_ONLY option in curl and i m trying to fetch a page
> via proxy with authentication. It doesn't seem to work. On analyzing, using
> a packet sniffer i found that the proxy authentication credentials are not
> supplied.

Yes, I just checked the sources and it seems the code for CONNECT_ONLY is too
naive and won't do right.

A quick attempt at a fix would be this:

diff -u -r1.301 transfer.c
--- lib/transfer.c 22 Jun 2006 21:36:54 -0000 1.301
+++ lib/transfer.c 4 Jul 2006 11:15:26 -0000
@@ -2223,7 +2223,7 @@

      if(res == CURLE_OK) {
        bool do_done;
- if(data->set.connect_only) {
+ if(data->set.connect_only && data->state.authdone) {
          /* keep connection open for application to use the socket */
          conn->bits.close = FALSE;
          res = Curl_done(&conn, CURLE_OK);

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2006-07-04