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 2019/09/12 08:07:46 UTC

[httpcomponents-core] 03/03: HTTPCORE-599: I/O sessions to stop reading from the underlying network channel of READ interest is disabled

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

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

commit 44cab548cb4e15d56235aa12eaf0898d028351d0
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Tue Sep 10 12:20:20 2019 +0200

    HTTPCORE-599: I/O sessions to stop reading from the underlying network channel of READ interest is disabled
---
 httpcore5/src/main/java/org/apache/hc/core5/reactor/IOSessionImpl.java | 3 +++
 1 file changed, 3 insertions(+)

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 a4ed30c..6a5ce53 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
@@ -183,6 +183,9 @@ class IOSessionImpl implements IOSession {
 
     @Override
     public int read(final ByteBuffer dst) throws IOException {
+        if ((this.key.interestOps() & SelectionKey.OP_READ) == 0) {
+            return 0;
+        }
         return this.channel.read(dst);
     }