]> granicus.if.org Git - curl/commitdiff
Bug report #1812190 (http://curl.haxx.se/bug/view.cgi?id=1812190) points out
authorDaniel Stenberg <daniel@haxx.se>
Tue, 23 Oct 2007 21:00:51 +0000 (21:00 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 23 Oct 2007 21:00:51 +0000 (21:00 +0000)
that libcurl tried to re-use connections a bit too much when using non-SSL
protocols tunneled over a HTTP proxy.

CHANGES
RELEASE-NOTES
TODO-RELEASE
lib/url.c

diff --git a/CHANGES b/CHANGES
index bc798bb1b87f6b1d5d4ff90ef32b5f49c062a949..89855d74b75191203995d4229e0edf6eb290c8c7 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,11 @@
 
                                   Changelog
 
+Daniel S (23 October 2007)
+- Bug report #1812190 (http://curl.haxx.se/bug/view.cgi?id=1812190) points out
+  that libcurl tried to re-use connections a bit too much when using non-SSL
+  protocols tunneled over a HTTP proxy.
+
 Daniel S (22 October 2007)
 - Michal Marek forwarded the bug report
   https://bugzilla.novell.com/show_bug.cgi?id=332917 about a HTTP redirect to
index cbc24b8baa42516fbba70e33057c18b074fe2fdc..65d23608a196b61d7678982ed818f7037f00024f 100644 (file)
@@ -41,6 +41,8 @@ This release includes the following bugfixes:
  o specifying a proxy with a trailing slash didn't work (unless it also
    contained a port number)
  o redirect from HTTP to FTP memory problem
+ o re-used connections a bit too much when using non-SSL protocols tunneled
+   over a HTTP proxy
 
 This release includes the following known bugs:
 
index 10ca2ed74c5175cb7422d331129772268437ffc9..563d0372aa12fe78394b4086143577452bfca2f4 100644 (file)
@@ -1,7 +1,4 @@
-To be addressed before 7.17.1 (planned release: November 2007)
+To be addressed before 7.17.1 (planned release: late October 2007)
 =============================
 
-104 - [ curl-Bugs-1812190 ] libcurl can use wrong connection, when using
-      https
-
 106 - 
index 1fc11f1c76cca9266e48a772e17791f582db37ea..9d6be5315d2dbb6bbb96adc6230adfe1129f91bf 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -2399,14 +2399,18 @@ ConnectionExists(struct SessionHandle *data,
       /* don't do mixed SSL and non-SSL connections */
       continue;
 
-    if(!needle->bits.httpproxy || needle->protocol&PROT_SSL) {
-      /* The requested connection does not use a HTTP proxy or it
-         uses SSL. */
+    if(needle->bits.proxy != check->bits.proxy)
+      /* don't do mixed proxy and non-proxy connections */
+      continue;
 
-      if(!(needle->protocol&PROT_SSL) && check->bits.httpproxy)
-        /* we don't do SSL but the cached connection has a proxy,
-           then don't match this */
-        continue;
+    if(!needle->bits.httpproxy || needle->protocol&PROT_SSL ||
+       (needle->bits.httpproxy && check->bits.httpproxy &&
+        needle->bits.tunnel_proxy && check->bits.tunnel_proxy &&
+        strequal(needle->proxy.name, check->proxy.name) &&
+        (needle->port == check->port))) {
+      /* The requested connection does not use a HTTP proxy or it uses SSL or
+         it is a non-SSL protocol tunneled over the same http proxy name and
+         port number */
 
       if(strequal(needle->protostr, check->protostr) &&
          strequal(needle->host.name, check->host.name) &&