hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r189801 - /jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/AbstractHttpConnection.java
Date Thu, 09 Jun 2005 19:44:40 GMT
Author: olegk
Date: Thu Jun  9 12:44:38 2005
New Revision: 189801

URL: http://svn.apache.org/viewcvs?rev=189801&view=rev
Log:
Perform additional checks on the state of the underlying socket when closing connection

Modified:
    jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/AbstractHttpConnection.java

Modified: jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/AbstractHttpConnection.java
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/AbstractHttpConnection.java?rev=189801&r1=189800&r2=189801&view=diff
==============================================================================
--- jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/AbstractHttpConnection.java
(original)
+++ jakarta/httpclient/trunk/http-common/src/java/org/apache/http/impl/AbstractHttpConnection.java
Thu Jun  9 12:44:38 2005
@@ -138,9 +138,15 @@
         this.datatransmitter = null;
         Socket tmpsocket = this.socket;
         if (tmpsocket != null) {
-            tmpsocket.shutdownOutput();
-            tmpsocket.shutdownInput();
-            tmpsocket.close();
+            if (!tmpsocket.isClosed()) {
+                if (!tmpsocket.isOutputShutdown()) {
+                    tmpsocket.shutdownOutput();
+                }
+                if (!tmpsocket.isInputShutdown()) {
+                    tmpsocket.shutdownInput();
+                }
+                tmpsocket.close();
+            }
         }
         this.socket = null;
     }



Mime
View raw message