[prev in list] [next in list] [prev in thread] [next in thread] 

List:       httpcomponents-commits
Subject:    [httpcomponents-core] branch master updated: Calculate pendingOutputRequests before calling produceO
From:       olegk () apache ! org
Date:       2020-09-28 12:20:29
Message-ID: 160129562962.5962.3559728265636363531 () gitbox ! apache ! org
[Download RAW message or body]

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


The following commit(s) were added to refs/heads/master by this push:
     new 3cce356  Calculate pendingOutputRequests before calling produceOutput to \
avoid race condition 3cce356 is described below

commit 3cce3564f4c0f923b237b6c64871fded2ca696ef
Author: ColinWeld <c_weld@backblaze.com>
AuthorDate: Thu Sep 24 17:25:16 2020 -0700

    Calculate pendingOutputRequests before calling produceOutput to avoid race \
                condition
---
 .../org/apache/hc/core5/http/impl/nio/AbstractHttp1StreamDuplexer.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/AbstractHttp1StreamDuplexer.java \
b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/AbstractHttp1StreamDuplexer.java
 index 1fcfe5e..d8b27d6 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/AbstractHttp1StreamDuplexer.java
                
+++ b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/AbstractHttp1StreamDuplexer.java
 @@ -346,8 +346,8 @@ abstract class AbstractHttp1StreamDuplexer<IncomingMessage \
extends HttpMessage,  ioSession.getLock().unlock();
         }
         if (connState.compareTo(ConnectionState.SHUTDOWN) < 0) {
-            produceOutput();
             final int pendingOutputRequests = outputRequests.get();
+            produceOutput();
             final boolean outputPending = isOutputReady();
             final boolean outputEnd;
             ioSession.getLock().lock();


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic