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/11 19:21:15 UTC
[httpcomponents-core] 02/02: 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 HTTPCORE-658
in repository https://gitbox.apache.org/repos/asf/httpcomponents-core.git
commit f7e876bbb9ca165918e5826aa8bbba0f8b6d2268
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Mon Jan 11 20:20:00 2021 +0100
HTTPCORE-658: removed explicit inbound / outbound socket shutdown from the `#close` method of classic HTTP connections
---
.../apache/hc/core5/http/impl/io/BHttpConnectionBase.java | 12 ------------
.../hc/core5/http/impl/io/TestBHttpConnectionBase.java | 2 --
2 files changed, 14 deletions(-)
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/io/BHttpConnectionBase.java b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/io/BHttpConnectionBase.java
index ecbb010..9d2531d 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/io/BHttpConnectionBase.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/io/BHttpConnectionBase.java
@@ -252,18 +252,6 @@ class BHttpConnectionBase implements BHttpConnection {
try (final Socket socket = socketHolder.getSocket()) {
this.inBuffer.clear();
this.outbuffer.flush(socketHolder.getOutputStream());
- 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
- }
}
}
}
diff --git a/httpcore5/src/test/java/org/apache/hc/core5/http/impl/io/TestBHttpConnectionBase.java b/httpcore5/src/test/java/org/apache/hc/core5/http/impl/io/TestBHttpConnectionBase.java
index bcd29bd..e098c33 100644
--- a/httpcore5/src/test/java/org/apache/hc/core5/http/impl/io/TestBHttpConnectionBase.java
+++ b/httpcore5/src/test/java/org/apache/hc/core5/http/impl/io/TestBHttpConnectionBase.java
@@ -116,8 +116,6 @@ public class TestBHttpConnectionBase {
Mockito.verify(outStream, Mockito.times(1)).write(
ArgumentMatchers.<byte[]>any(), ArgumentMatchers.anyInt(), ArgumentMatchers.anyInt());
- Mockito.verify(socket, Mockito.times(1)).shutdownInput();
- Mockito.verify(socket, Mockito.times(1)).shutdownOutput();
Mockito.verify(socket, Mockito.times(1)).close();
conn.close();