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 2020/10/22 07:23:55 UTC

[httpcomponents-core] branch 4.4.x updated: Bug fix: non-blocking TLSv1.3 connections can end up in an infinite event spin when closed concurrently by the local and the remote endpoints

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


The following commit(s) were added to refs/heads/4.4.x by this push:
     new bf12c7d  Bug fix: non-blocking TLSv1.3 connections can end up in an infinite event spin when closed concurrently by the local and the remote endpoints
bf12c7d is described below

commit bf12c7dd9eabf0cd75bd6c70ac6b285b0d4430a5
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Wed Oct 21 18:11:14 2020 +0200

    Bug fix: non-blocking TLSv1.3 connections can end up in an infinite event spin when closed concurrently by the local and the remote endpoints
---
 .../src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java   | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java b/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
index 21dc7d9..4f156df 100644
--- a/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
+++ b/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
@@ -421,11 +421,15 @@ public class SSLIOSession implements IOSession, SessionBufferStatus, SocketAcces
                 !this.inPlain.hasData() &&
                 (this.appBufferStatus == null || !this.appBufferStatus.hasBufferedInput())) {
             newMask = newMask & ~EventMask.READ;
+        } else if (this.status == CLOSING) {
+            newMask = newMask | EventMask.READ;
         }
 
         // Do we have encrypted data ready to be sent?
         if (this.outEncrypted.hasData()) {
             newMask = newMask | EventMask.WRITE;
+        } else if (this.sslEngine.isOutboundDone()) {
+            newMask = newMask & ~EventMask.WRITE;
         }
 
         // Update the mask if necessary