You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2020/07/08 22:54:34 UTC

[tomcat] branch 8.5.x updated: Check empty flag when calculating available bytes

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

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


The following commit(s) were added to refs/heads/8.5.x by this push:
     new 452081a  Check empty flag when calculating available bytes
452081a is described below

commit 452081a4b236f7afb64acfe74ded5e3eea7b620f
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Jul 8 23:53:03 2020 +0100

    Check empty flag when calculating available bytes
---
 java/org/apache/coyote/ajp/AjpProcessor.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/coyote/ajp/AjpProcessor.java b/java/org/apache/coyote/ajp/AjpProcessor.java
index 43e7366..4a297f5 100644
--- a/java/org/apache/coyote/ajp/AjpProcessor.java
+++ b/java/org/apache/coyote/ajp/AjpProcessor.java
@@ -1458,7 +1458,11 @@ public class AjpProcessor extends AbstractProcessor {
 
         @Override
         public int available() {
-            return bodyBytes.getByteChunk().getLength();
+            if (empty) {
+                return 0;
+            } else {
+                return bodyBytes.getByteChunk().getLength();
+            }
         }
     }
 


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