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/21 20:40:13 UTC

[httpcomponents-core] branch 5.0.x updated: HTTPCORE-644: 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 5.0.x
in repository https://gitbox.apache.org/repos/asf/httpcomponents-core.git


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

commit 686d8cf3b8cda9d3871e7754e2ef5dcc8283dbea
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Wed Oct 21 22:34:18 2020 +0200

    HTTPCORE-644: 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/hc/core5/reactor/ssl/SSLIOSession.java   | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java b/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java
index c135ea4..806794c 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java
@@ -435,11 +435,15 @@ public class SSLIOSession implements IOSession {
 
             if (this.endOfStream && !this.inPlain.hasData()) {
                 newMask = newMask & ~EventMask.READ;
+            } else if (this.status == 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