HTTPCLIENT-622 with minor modifications

git-svn-id: https://svn.apache.org/repos/asf/jakarta/httpcomponents/httpclient/trunk@498133 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Roland Weber 2007-01-20 16:01:58 +00:00
parent 613fb5221d
commit 3d8d85a915
1 changed files with 4 additions and 0 deletions

View File

@ -610,6 +610,8 @@ public class MultiThreadedHttpConnectionManager implements HttpConnectionManager
public synchronized void handleLostConnection(HostConfiguration config) { public synchronized void handleLostConnection(HostConfiguration config) {
HostConnectionPool hostPool = getHostPool(config); HostConnectionPool hostPool = getHostPool(config);
hostPool.numConnections--; hostPool.numConnections--;
if (hostPool.numConnections < 1)
mapHosts.remove(config);
numConnections--; numConnections--;
notifyWaitingThread(config); notifyWaitingThread(config);
@ -715,6 +717,8 @@ public class MultiThreadedHttpConnectionManager implements HttpConnectionManager
hostPool.freeConnections.remove(connection); hostPool.freeConnections.remove(connection);
hostPool.numConnections--; hostPool.numConnections--;
numConnections--; numConnections--;
if (hostPool.numConnections < 1)
mapHosts.remove(connectionConfiguration);
// remove the connection from the timeout handler // remove the connection from the timeout handler
idleConnectionHandler.remove(connection); idleConnectionHandler.remove(connection);