From 01368d395ccdd8cae450c053f6275617850da60f Mon Sep 17 00:00:00 2001 From: Frank Meier Date: Mon, 11 Aug 2014 00:06:20 +0200 Subject: create_conn: prune dead connections Bringing back the old functionality that was mistakenly removed when the connection cache was remade. When creating a new connection, all the existing ones are checked and those that are known to be dead get disconnected for real and removed from the connection cache. It helps the cache from holding on to very many stale connections and aids in keeping down the number of system sockets in wait states. Help-by: Jonatan Vela Bug: http://curl.haxx.se/mail/lib-2014-06/0189.html --- lib/conncache.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/conncache.c') diff --git a/lib/conncache.c b/lib/conncache.c index 290638ea0..5bbcf3c86 100644 --- a/lib/conncache.c +++ b/lib/conncache.c @@ -202,6 +202,7 @@ void Curl_conncache_foreach(struct conncache *connc, struct connectdata *conn; bundle = he->ptr; + he = Curl_hash_next_element(&iter); curr = bundle->conn_list->head; while(curr) { @@ -213,8 +214,6 @@ void Curl_conncache_foreach(struct conncache *connc, if(1 == func(conn, param)) return; } - - he = Curl_hash_next_element(&iter); } } -- cgit v1.2.3