[Bug 358147] Add catch for UnknownHostException to fix leaky file descriptor in client
This commit is contained in:
parent
4b7f8d79dd
commit
21ddd768f0
|
@ -15,6 +15,7 @@ package org.eclipse.jetty.client;
|
|||
|
||||
import java.io.IOException;
|
||||
import java.net.SocketTimeoutException;
|
||||
import java.net.UnknownHostException;
|
||||
import java.nio.channels.SelectionKey;
|
||||
import java.nio.channels.SocketChannel;
|
||||
import java.nio.channels.UnresolvedAddressException;
|
||||
|
@ -110,11 +111,17 @@ class SelectConnector extends AbstractLifeCycle implements HttpClient.Connector
|
|||
{
|
||||
channel.connect(address.toSocketAddress());
|
||||
}
|
||||
catch (UnresolvedAddressException ex)
|
||||
catch (UnresolvedAddressException uae)
|
||||
{
|
||||
channel.close();
|
||||
throw ex;
|
||||
throw uae;
|
||||
}
|
||||
catch ( UnknownHostException uhe )
|
||||
{
|
||||
channel.close();
|
||||
throw uhe;
|
||||
}
|
||||
|
||||
_selectorManager.register(channel,destination);
|
||||
ConnectTimeout connectTimeout = new ConnectTimeout(channel,destination);
|
||||
_httpClient.schedule(connectTimeout,_httpClient.getConnectTimeout());
|
||||
|
|
Loading…
Reference in New Issue