You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by sebb <se...@gmail.com> on 2010/08/25 23:52:37 UTC
Re: svn commit: r989343 - /httpcomponents/httpclient/branches/4.0.x/httpclient/src/main/java/org/apache/http/impl/conn/DefaultClientConnection.java
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-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org
Re: svn commit: r989343
Posted by Oleg Kalnichevski <ol...@apache.org>.
On Wed, 2010-08-25 at 22:52 +0100, sebb wrote:
> 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
> >
> Does it still throw IOE?
>
No, but this is required for binary compatibility / defined by the
interface contract.
Oleg
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org