cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: PATCH: Fix for bug 440

From: Arunav Sanyal <arunav.sanyal91_at_gmail.com>
Date: Thu, 28 Mar 2013 20:08:12 +0530

Patch in required format, sorry about the previous error daniel

Command run : diff -u http.c http_new.c > difference.txt(ran on ubunu 12.10
gnu diff)
curl version - 7.29.0

This patch fixes bug 440

Contents of difference.txt:-

--- http.c 2013-03-27 22:42:30.827335094 +0530
+++ http_new.c 2013-03-27 22:41:18.935011448 +0530
@@ -439,13 +439,15 @@
   if(data->state.authproblem)
     return data->set.http_fail_on_error?CURLE_HTTP_RETURNED_ERROR:CURLE_OK;

- if(((data->req.httpcode == 401) ||
+ if(conn->bits.user_passwd &&
+ ((data->req.httpcode == 401) ||
       (conn->bits.authneg && data->req.httpcode < 300))) {
     pickhost = pickoneauth(&data->state.authhost);
     if(!pickhost)
       data->state.authproblem = TRUE;
   }
- if(((data->req.httpcode == 407) ||
+ if(conn->bits.proxy_user_passwd &&
+ ((data->req.httpcode == 407) ||
       (conn->bits.authneg && data->req.httpcode < 300))) {
     pickproxy = pickoneauth(&data->state.authproxy);
     if(!pickproxy)
@@ -622,15 +624,6 @@
   authhost = &data->state.authhost;
   authproxy = &data->state.authproxy;

- if((conn->bits.httpproxy && conn->bits.proxy_user_passwd) ||
- conn->bits.user_passwd)
- /* continue please */ ;
- else {
- authhost->done = TRUE;
- authproxy->done = TRUE;
- return CURLE_OK; /* no authentication with no user or password */
- }
-
   if(authhost->want && !authhost->picked)
     /* The app has selected one or more methods, but none has been picked
        so far by a server round-trip. Then we set the picked one to the

-- 
Arunav Sanyal
4th year undergraduate student
B.E (Hons) Computer Science
BITS Pilani K.K Birla Goa Campus

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-03-28