diff --git a/httpclient/src/main/java/org/apache/http/impl/conn/DefaultClientConnection.java b/httpclient/src/main/java/org/apache/http/impl/conn/DefaultClientConnection.java index 107a97537..a45133bba 100644 --- a/httpclient/src/main/java/org/apache/http/impl/conn/DefaultClientConnection.java +++ b/httpclient/src/main/java/org/apache/http/impl/conn/DefaultClientConnection.java @@ -146,20 +146,26 @@ public class DefaultClientConnection extends SocketHttpClientConnection */ @Override public void shutdown() throws IOException { - log.debug("Connection shut down"); shutdown = true; - - super.shutdown(); - Socket sock = this.socket; // copy volatile attribute - if (sock != null) - sock.close(); - + try { + super.shutdown(); + log.debug("Connection shut down"); + Socket sock = this.socket; // copy volatile attribute + if (sock != null) + sock.close(); + } catch (IOException ex) { + log.debug("I/O error shutting down connection", ex); + } } @Override public void close() throws IOException { - log.debug("Connection closed"); - super.close(); + try { + super.close(); + log.debug("Connection closed"); + } catch (IOException ex) { + log.debug("I/O error closing connection", ex); + } } @Override