Imported Upstream version 7.53.1
[platform/upstream/curl.git] / lib / conncache.c
index 32a7030..a51c8fd 100644 (file)
@@ -30,7 +30,6 @@
 #include "progress.h"
 #include "multiif.h"
 #include "sendf.h"
-#include "rawstr.h"
 #include "conncache.h"
 /* The last 3 #include files should be in this order */
 #include "curl_printf.h"
@@ -133,14 +132,16 @@ static char *hashkey(struct connectdata *conn)
 {
   const char *hostname;
 
-  if(conn->bits.proxy)
-    hostname = conn->proxy.name;
+  if(conn->bits.socksproxy)
+    hostname = conn->socks_proxy.host.name;
+  else if(conn->bits.httpproxy)
+    hostname = conn->http_proxy.host.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->port);
+  return aprintf("%s:%ld", hostname, conn->port);
 }
 
 /* Look up the bundle with all the connections to the same host this