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

markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit b66b1f23f27ca1ac9da25e1d34f55d1bf8bb0b96
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Mon Mar 22 21:43:27 2021 +0000

    Refactor isReady() in preparation for fix of BZ 64771
    
    https://bz.apache.org/bugzilla/show_bug.cgi?id=64771
---
 java/org/apache/catalina/connector/InputBuffer.java | 6 +-----
 java/org/apache/coyote/Request.java                 | 7 +++++++
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/java/org/apache/catalina/connector/InputBuffer.java 
b/java/org/apache/catalina/connector/InputBuffer.java
index 9b8ebb7..79090ee 100644
--- a/java/org/apache/catalina/connector/InputBuffer.java
+++ b/java/org/apache/catalina/connector/InputBuffer.java
@@ -27,8 +27,6 @@ import java.security.PrivilegedActionException;
 import java.security.PrivilegedExceptionAction;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.atomic.AtomicBoolean;
-
 import jakarta.servlet.ReadListener;
 
 import org.apache.catalina.security.SecurityUtil;
@@ -301,9 +299,7 @@ public class InputBuffer extends Reader
             return true;
         }
 
-        AtomicBoolean result = new AtomicBoolean();
-        coyoteRequest.action(ActionCode.NB_READ_INTEREST, result);
-        return result.get();
+        return coyoteRequest.isReady();
     }
 
 
diff --git a/java/org/apache/coyote/Request.java 
b/java/org/apache/coyote/Request.java
index 219eb5f..e30a91a 100644
--- a/java/org/apache/coyote/Request.java
+++ b/java/org/apache/coyote/Request.java
@@ -194,6 +194,13 @@ public final class Request {
         this.listener = listener;
     }
 
+    public boolean isReady() {
+        AtomicBoolean result = new AtomicBoolean();
+        action(ActionCode.NB_READ_INTEREST, result);
+        return result.get();
+    }
+
+
     private final AtomicBoolean allDataReadEventSent = new 
AtomicBoolean(false);
 
     public boolean sendAllDataReadEvent() {

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to