From cd8d23624594e21c37a0453459229a90a38ad471 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Mon, 25 Jan 2016 14:37:24 +0100 Subject: news: CURLOPT_CONNECT_TO and --connect-to Makes curl connect to the given host+port instead of the host+port found in the URL. --- lib/conncache.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'lib/conncache.c') diff --git a/lib/conncache.c b/lib/conncache.c index 6e03caf3c..89086590a 100644 --- a/lib/conncache.c +++ b/lib/conncache.c @@ -132,9 +132,16 @@ void Curl_conncache_destroy(struct conncache *connc) /* returns an allocated key to find a bundle for this connection */ static char *hashkey(struct connectdata *conn) { - return aprintf("%s:%d", - conn->bits.proxy?conn->proxy.name:conn->host.name, - conn->localport); + const char *hostname; + + if(conn->bits.proxy) + hostname = conn->proxy.name; + else if(conn->bits.conn_to_host) + hostname = conn->conn_to_host.name; + else + hostname = conn->host.name; + + return aprintf("%s:%d", hostname, conn->localport); } /* Look up the bundle with all the connections to the same host this -- cgit v1.2.3