aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2007-02-27 22:12:15 +0000
committerDaniel Stenberg <daniel@haxx.se>2007-02-27 22:12:15 +0000
commit060f7ca2d2a7f5c8845a62a143c1d9fa988d1269 (patch)
treeece6bd391dfb56c808fae61e599e508baa83fd7a /lib
parent638c715a5122697a34685615f24855b8417562f1 (diff)
- 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
Diffstat (limited to 'lib')
-rw-r--r--lib/url.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/url.c b/lib/url.c
index 64a145cdb..87a07736e 100644
--- 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;