Blame SOURCES/0019-curl-7.29.0-517b06d6.patch

c260e0
From 46e85fee025964dd9a8ce2d615bc5f8ece530519 Mon Sep 17 00:00:00 2001
c260e0
From: Steve Holme <steve_holme@hotmail.com>
c260e0
Date: Thu, 20 Feb 2014 23:51:36 +0000
c260e0
Subject: [PATCH] url: Fixed connection re-use when using different log-in credentials
c260e0
c260e0
In addition to FTP, other connection based protocols such as IMAP, POP3,
c260e0
SMTP, SCP, SFTP and LDAP require a new connection when different log-in
c260e0
credentials are specified. Fixed the detection logic to include these
c260e0
other protocols.
c260e0
c260e0
Bug: http://curl.haxx.se/docs/adv_20140326A.html
c260e0
c260e0
[upstream commit 517b06d657aceb11a234b05cc891170c367ab80d]
c260e0
c260e0
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
c260e0
---
c260e0
 lib/http.c    |    2 +-
c260e0
 lib/url.c     |    6 +++---
c260e0
 lib/urldata.h |    2 ++
c260e0
 3 files changed, 6 insertions(+), 4 deletions(-)
c260e0
c260e0
diff --git a/lib/http.c b/lib/http.c
c260e0
index f4b7a48..c78036b 100644
c260e0
--- a/lib/http.c
c260e0
+++ b/lib/http.c
c260e0
@@ -142,7 +142,7 @@ const struct Curl_handler Curl_handler_https = {
c260e0
   ZERO_NULL,                            /* readwrite */
c260e0
   PORT_HTTPS,                           /* defport */
c260e0
   CURLPROTO_HTTP | CURLPROTO_HTTPS,     /* protocol */
c260e0
-  PROTOPT_SSL                           /* flags */
c260e0
+  PROTOPT_SSL | PROTOPT_CREDSPERREQUEST /* flags */
c260e0
 };
c260e0
 #endif
c260e0
 
c260e0
diff --git a/lib/url.c b/lib/url.c
c260e0
index 9690dfa..0174ff4 100644
c260e0
--- a/lib/url.c
c260e0
+++ b/lib/url.c
c260e0
@@ -2961,10 +2961,10 @@ ConnectionExists(struct SessionHandle *data,
c260e0
               continue;
c260e0
             }
c260e0
           }
c260e0
-          if((needle->handler->protocol & CURLPROTO_FTP) ||
c260e0
+          if((!(needle->handler->flags & PROTOPT_CREDSPERREQUEST)) ||
c260e0
              ((needle->handler->protocol & CURLPROTO_HTTP) && wantNTLM)) {
c260e0
-            /* This is FTP or HTTP+NTLM, verify that we're using the same name
c260e0
-               and password as well */
c260e0
+            /* This proto requires credentials per connection or is HTTP+NTLM,
c260e0
+               so verify that we're using the same name and password as well */
c260e0
             if(!strequal(needle->user, check->user) ||
c260e0
                !strequal(needle->passwd, check->passwd)) {
c260e0
               /* one of them was different */
c260e0
diff --git a/lib/urldata.h b/lib/urldata.h
c260e0
index d597c67..cbf4102 100644
c260e0
--- a/lib/urldata.h
c260e0
+++ b/lib/urldata.h
c260e0
@@ -755,6 +755,8 @@ struct Curl_handler {
c260e0
                                       gets a default */
c260e0
 #define PROTOPT_NOURLQUERY (1<<6)   /* protocol can't handle
c260e0
                                         url query strings (?foo=bar) ! */
c260e0
+#define PROTOPT_CREDSPERREQUEST (1<<7) /* requires login creditials per request
c260e0
+                                          as opposed to per connection */
c260e0
 
c260e0
 
c260e0
 /* return the count of bytes sent, or -1 on error */
c260e0
-- 
c260e0
1.7.1
c260e0