]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
- Hang Kin Lau found and fixed: When I use libcurl to connect to an https
authorDaniel Stenberg <daniel@haxx.se>
Tue, 27 Feb 2007 22:12:15 +0000 (22:12 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 27 Feb 2007 22:12:15 +0000 (22:12 +0000)
  server through a proxy and have the remote https server port set using the
  CURLOPT_PORT option, protocol gets reset to http from https after the first
  request.

  User defined URL was modified internally by libcurl and subsequent reuse of
  the easy handle may lead to connection using a different protocol (if not
  originally http).

  I found that libcurl hardcoded the protocol to "http" when it tries to
  regenerate the URL if CURLOPT_PORT is set. I tried to fix the problem as
  follows and it's working fine so far

CHANGES
RELEASE-NOTES
lib/url.c

diff --git a/CHANGES b/CHANGES
index 2867cb7b7e9b8e6b71013fa2e43b365aa870c973..9fb1522e97c3a43abe7c3c0a84f66d648021a9a7 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,20 @@
 
                                   Changelog
 
+Daniel (27 February 2007)
+- Hang Kin Lau found and fixed: When I use libcurl to connect to an https
+  server through a proxy and have the remote https server port set using the
+  CURLOPT_PORT option, protocol gets reset to http from https after the first
+  request.
+  User defined URL was modified internally by libcurl and subsequent reuse of
+  the easy handle may lead to connection using a different protocol (if not
+  originally http).
+  I found that libcurl hardcoded the protocol to "http" when it tries to
+  regenerate the URL if CURLOPT_PORT is set. I tried to fix the problem as
+  follows and it's working fine so far
+
 Daniel (25 February 2007)
 - Adam D. Moss made the HTTP CONNECT procedure less blocking when used from
   the multi interface. Note that it still does a part of the connection in a
index 8a9e2f02c5af99a9a94e64bcab38c13d5d0ea7cb..97ca13ea48d0a4da078634b69d2e6238c8ceac2a 100644 (file)
@@ -36,6 +36,7 @@ This release includes the following bugfixes:
  o HTTP CONNECT thru a proxy is now less blocking when the multi interface is
    used
  o HTTP Digest header parsing fix for unquoted last word ending with CRLF
+ o CURLOPT_PORT, HTTP proxy, re-using connections and non-HTTP protocols
 
 This release includes the following known bugs:
 
@@ -56,6 +57,6 @@ advice from friends like these:
  Yang Tse, Manfred Schwarb, Michael Wallner, Jeff Pohlmeyer, Shmulik Regev,
  Rob Crittenden, Robert A. Monat, Dan Fandrich, Duncan Mac-Vicar Prett,
  Michal Marek, Robson Braga Araujo, Ian Turner, Linus Nielsen Feltzing,
- Ravi Pratap, Adam D. Moss, Jose Kahan
+ Ravi Pratap, Adam D. Moss, Jose Kahan, Hang Kin Lau
 
         Thanks! (and sorry if I forgot to mention someone)
index 64a145cdbf446f2c371d685ba5a8c55d9f48c0c9..87a07736edd33a1642a7e0e13fb2c3e33008f8ee 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -3590,8 +3590,8 @@ else {
       /* we need to create new URL with the new port number */
       char *url;
 
-      url = aprintf("http://%s:%d%s", conn->host.name, conn->remote_port,
-                    data->reqdata.path);
+      url = aprintf("%s://%s:%d%s", conn->protostr, conn->host.name,
+                    conn->remote_port, data->reqdata.path);
       if(!url)
         return CURLE_OUT_OF_MEMORY;