diff options
author | Michael Kaufmann <mail@michael-kaufmann.ch> | 2016-01-25 14:37:24 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2016-04-17 23:50:59 +0200 |
commit | cd8d23624594e21c37a0453459229a90a38ad471 (patch) | |
tree | 57afa8a5d73bffd4f3b08ef691d68ff2d03d4c7f /lib/multi.c | |
parent | f86f50f05a466f8960d94179ca46e9561458c567 (diff) |
news: CURLOPT_CONNECT_TO and --connect-to
Makes curl connect to the given host+port instead of the host+port found
in the URL.
Diffstat (limited to 'lib/multi.c')
-rw-r--r-- | lib/multi.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/multi.c b/lib/multi.c index b1c1f5396..aec377d96 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -1464,9 +1464,15 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi, { struct Curl_dns_entry *dns = NULL; struct connectdata *conn = data->easy_conn; + const char *hostname; + + if(conn->bits.conn_to_host) + hostname = conn->conn_to_host.name; + else + hostname = conn->host.name; /* check if we have the name resolved by now */ - dns = Curl_fetch_addr(conn, conn->host.name, (int)conn->port); + dns = Curl_fetch_addr(conn, hostname, (int)conn->port); if(dns) { #ifdef CURLRES_ASYNCH |