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

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

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

Mark Thomas-2
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 <[hidden email]>
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: [hidden email]
For additional commands, e-mail: [hidden email]