summaryrefslogtreecommitdiff
path: root/lib/http_proxy.c
diff options
context:
space:
mode:
authorMichael Kaufmann <mail@michael-kaufmann.ch>2017-02-18 13:56:56 +0100
committerMichael Kaufmann <mail@michael-kaufmann.ch>2017-02-18 15:04:43 +0100
commit2f8d0df085519351dbd7123178895ba910d756c1 (patch)
tree1ec8c16fb218c3dcf26e90d183eb7aad5fecebc2 /lib/http_proxy.c
parent13e3a18b345af1a15b892b0bbedfbbff06e10a39 (diff)
downloadcurl-2f8d0df085519351dbd7123178895ba910d756c1.tar.gz
proxy: fix hostname resolution and IDN conversion
Properly resolve, convert and log the proxy host names. Support the "--connect-to" feature for SOCKS proxies and for passive FTP data transfers. Follow-up to cb4e2be Reported-by: Jay Satiro Fixes https://github.com/curl/curl/issues/1248
Diffstat (limited to 'lib/http_proxy.c')
-rw-r--r--lib/http_proxy.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/http_proxy.c b/lib/http_proxy.c
index d523ba519..7fde11dbb 100644
--- a/lib/http_proxy.c
+++ b/lib/http_proxy.c
@@ -98,16 +98,21 @@ CURLcode Curl_proxy_connect(struct connectdata *conn, int sockindex)
* original pointer
*
* This function might be called several times in the multi interface case
- * if the proxy's CONNTECT response is not instant.
+ * if the proxy's CONNECT response is not instant.
*/
prot_save = conn->data->req.protop;
memset(&http_proxy, 0, sizeof(http_proxy));
conn->data->req.protop = &http_proxy;
connkeep(conn, "HTTP proxy CONNECT");
- if(sockindex == SECONDARYSOCKET)
- hostname = conn->secondaryhostname;
- else if(conn->bits.conn_to_host)
+
+ /* for the secondary socket (FTP), use the "connect to host"
+ * but ignore the "connect to port" (use the secondary port)
+ */
+
+ if(conn->bits.conn_to_host)
hostname = conn->conn_to_host.name;
+ else if(sockindex == SECONDARYSOCKET)
+ hostname = conn->secondaryhostname;
else
hostname = conn->host.name;