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 13b04b3e5c Fix BZ 66511 - GZip output with direct buffer was broken
13b04b3e5c is described below

commit 13b04b3e5c7347dc263442f450105bc8ed798b4e
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Mon Mar 6 14:26:29 2023 +0000

    Fix BZ 66511 - GZip output with direct buffer was broken
    
    Patch suggested by Arjen Poutsma
    https://bz.apache.org/bugzilla/show_bug.cgi?id=66511
---
 java/org/apache/coyote/http11/filters/GzipOutputFilter.java | 2 +-
 webapps/docs/changelog.xml                                  | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/coyote/http11/filters/GzipOutputFilter.java 
b/java/org/apache/coyote/http11/filters/GzipOutputFilter.java
index e69179506e..834e563384 100644
--- a/java/org/apache/coyote/http11/filters/GzipOutputFilter.java
+++ b/java/org/apache/coyote/http11/filters/GzipOutputFilter.java
@@ -87,7 +87,7 @@ public class GzipOutputFilter implements OutputFilter {
             chunk.position(chunk.position() + len);
         } else {
             byte[] bytes = new byte[len];
-            chunk.put(bytes);
+            chunk.get(bytes);
             compressionStream.write(bytes, 0, len);
         }
         return len;
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index e7e83b1b0e..f85493198a 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -125,6 +125,11 @@
         characters as defined in RFC 8259. Based on code submitted by
         Thomas Meyer. (remm)
       </fix>
+      <fix>
+        <bug>66511</bug>: Fix <code>GzipOutputFilter</code> (used for 
compressed
+        HTTP responses) when used with direct buffers. Patch suggested by Arjen
+        Poutsma. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Other">


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

Reply via email to