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 2022/10/08 14:53:21 UTC

[httpcomponents-core] 01/01: Hack out of desperation

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

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

commit 74be13ed67ad1a44e6fb46a4871e76a64b0d58d0
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Sat Oct 8 16:48:43 2022 +0200

    Hack out of desperation
---
 .../org/apache/hc/core5/reactor/IOSessionImpl.java    | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOSessionImpl.java b/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOSessionImpl.java
index c9439cbba..e55ed092c 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOSessionImpl.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOSessionImpl.java
@@ -29,7 +29,6 @@ package org.apache.hc.core5.reactor;
 
 import java.io.IOException;
 import java.net.SocketAddress;
-import java.net.SocketException;
 import java.nio.ByteBuffer;
 import java.nio.channels.ByteChannel;
 import java.nio.channels.SelectionKey;
@@ -256,15 +255,15 @@ class IOSessionImpl implements IOSession {
     @Override
     public void close(final CloseMode closeMode) {
         if (this.status.compareAndSet(Status.ACTIVE, Status.CLOSED)) {
-            if (closeMode == CloseMode.IMMEDIATE) {
-                try {
-                    this.channel.socket().setSoLinger(true, 0);
-                } catch (final SocketException e) {
-                    // Quietly ignore
-                }
-            }
-            this.key.cancel();
-            this.key.attach(null);
+//            if (closeMode == CloseMode.IMMEDIATE) {
+//                try {
+//                    this.channel.socket().setSoLinger(true, 0);
+//                } catch (final SocketException e) {
+//                    // Quietly ignore
+//                }
+//            }
+//            this.key.cancel();
+//            this.key.attach(null);
             Closer.closeQuietly(this.key.channel());
             if (this.key.selector().isOpen()) {
                 this.key.selector().wakeup();