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 e7019f6bbfdce78b88b82f1ed01add25290b3538
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Mon Mar 22 21:51:24 2021 +0000

    Refactor onDataAvailable() in preparation for fixing BZ 64771
    
    https://bz.apache.org/bugzilla/show_bug.cgi?id=64771
---
 java/org/apache/catalina/connector/CoyoteAdapter.java | 2 +-
 java/org/apache/coyote/Request.java                   | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/connector/CoyoteAdapter.java 
b/java/org/apache/catalina/connector/CoyoteAdapter.java
index b39f07b..ea3dbe4 100644
--- a/java/org/apache/catalina/connector/CoyoteAdapter.java
+++ b/java/org/apache/catalina/connector/CoyoteAdapter.java
@@ -207,7 +207,7 @@ public class CoyoteAdapter implements Adapter {
                         // onAllDataRead() event. Therefore, make sure
                         // onDataAvailable() is not called in this case.
                         if (!request.isFinished()) {
-                            readListener.onDataAvailable();
+                            req.onDataAvailable();
                         }
                         if (request.isFinished() && 
req.sendAllDataReadEvent()) {
                             readListener.onAllDataRead();
diff --git a/java/org/apache/coyote/Request.java 
b/java/org/apache/coyote/Request.java
index 4bee2b4..0fd62c3 100644
--- a/java/org/apache/coyote/Request.java
+++ b/java/org/apache/coyote/Request.java
@@ -216,6 +216,10 @@ public final class Request {
         return result.get();
     }
 
+    public void onDataAvailable() throws IOException {
+        listener.onDataAvailable();
+    }
+
 
     private final AtomicBoolean allDataReadEventSent = new 
AtomicBoolean(false);
 

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

Reply via email to