You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2021/01/13 19:01:26 UTC

[httpcomponents-core] 01/01: HTTPCORE-658: removed explicit inbound / outbound socket shutdown from the `#close` method of classic HTTP connections

This is an automated email from the ASF dual-hosted git repository.

olegk pushed a commit to branch 4.4.x
in repository https://gitbox.apache.org/repos/asf/httpcomponents-core.git

commit 0351d81a50a24f07c9dfb5a4e2ccf0378a71e060
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Wed Jan 13 19:56:46 2021 +0100

    HTTPCORE-658: removed explicit inbound / outbound socket shutdown from the `#close` method of classic HTTP connections
---
 .../main/java/org/apache/http/impl/BHttpConnectionBase.java  | 12 ------------
 .../java/org/apache/http/impl/TestBHttpConnectionBase.java   |  2 --
 2 files changed, 14 deletions(-)

diff --git a/httpcore/src/main/java/org/apache/http/impl/BHttpConnectionBase.java b/httpcore/src/main/java/org/apache/http/impl/BHttpConnectionBase.java
index e59b299..885c7c0 100644
--- a/httpcore/src/main/java/org/apache/http/impl/BHttpConnectionBase.java
+++ b/httpcore/src/main/java/org/apache/http/impl/BHttpConnectionBase.java
@@ -316,18 +316,6 @@ public class BHttpConnectionBase implements HttpInetConnection {
             try {
                 this.inBuffer.clear();
                 this.outbuffer.flush();
-                try {
-                    try {
-                        socket.shutdownOutput();
-                    } catch (final IOException ignore) {
-                    }
-                    try {
-                        socket.shutdownInput();
-                    } catch (final IOException ignore) {
-                    }
-                } catch (final UnsupportedOperationException ignore) {
-                    // if one isn't supported, the other one isn't either
-                }
             } finally {
                 socket.close();
             }
diff --git a/httpcore/src/test/java/org/apache/http/impl/TestBHttpConnectionBase.java b/httpcore/src/test/java/org/apache/http/impl/TestBHttpConnectionBase.java
index 111200c..30aa145 100644
--- a/httpcore/src/test/java/org/apache/http/impl/TestBHttpConnectionBase.java
+++ b/httpcore/src/test/java/org/apache/http/impl/TestBHttpConnectionBase.java
@@ -128,8 +128,6 @@ public class TestBHttpConnectionBase {
 
         Mockito.verify(outStream, Mockito.times(1)).write(
                 Matchers.<byte []>any(), Matchers.anyInt(), Matchers.anyInt());
-        Mockito.verify(socket, Mockito.times(1)).shutdownInput();
-        Mockito.verify(socket, Mockito.times(1)).shutdownOutput();
         Mockito.verify(socket, Mockito.times(1)).close();
 
         conn.close();