361456 - release timer task on connection failed

This commit is contained in:
Greg Wilkins 2011-10-21 09:20:30 +11:00
parent b0a9ec30f9
commit 50af4d4b62
1 changed files with 4 additions and 0 deletions

View File

@ -228,6 +228,10 @@ class SelectConnector extends AbstractLifeCycle implements HttpClient.Connector
@Override
protected void connectionFailed(SocketChannel channel, Throwable ex, Object attachment)
{
Timeout.Task connectTimeout = _connectingChannels.remove(channel);
if (connectTimeout != null)
connectTimeout.cancel();
if (attachment instanceof HttpDestination)
((HttpDestination)attachment).onConnectionFailed(ex);
else