On 25 August 2010 21:23,  <ol...@apache.org> wrote:
> Author: olegk
> Date: Wed Aug 25 20:23:38 2010
> New Revision: 989343
>
> URL: http://svn.apache.org/viewvc?rev=989343&view=rev
> Log:
> Catch and log I/O exceptions thrown by #close() and #shutdown() methods
>
> Modified:
>    
> httpcomponents/httpclient/branches/4.0.x/httpclient/src/main/java/org/apache/http/impl/conn/DefaultClientConnection.java
>
> Modified: 
> httpcomponents/httpclient/branches/4.0.x/httpclient/src/main/java/org/apache/http/impl/conn/DefaultClientConnection.java
> URL: 
> http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.0.x/httpclient/src/main/java/org/apache/http/impl/conn/DefaultClientConnection.java?rev=989343&r1=989342&r2=989343&view=diff
> ==============================================================================
> --- 
> httpcomponents/httpclient/branches/4.0.x/httpclient/src/main/java/org/apache/http/impl/conn/DefaultClientConnection.java
>  (original)
> +++ 
> httpcomponents/httpclient/branches/4.0.x/httpclient/src/main/java/org/apache/http/impl/conn/DefaultClientConnection.java
>  Wed Aug 25 20:23:38 2010
> @@ -138,20 +138,26 @@ public class DefaultClientConnection ext
>      */
>     @Override
>     public void shutdown() throws IOException {

Does it still throw IOE?

> -        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 {

Does it still throw IOE?

> -        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
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org

Reply via email to