[grizzly~git:1f07e7b7] [2.3.x] Fix for https://java.net/jira/browse/GRIZZLY-1547 (Enabling compr

  • From: rlubke@...
  • To: commits@...
  • Subject: [grizzly~git:1f07e7b7] [2.3.x] Fix for https://java.net/jira/browse/GRIZZLY-1547 (Enabling compr
  • Date: Thu, 18 Jul 2013 16:26:27 +0000

Project:    grizzly
Repository: git
Revision:   1f07e7b7dff8123d6000b2864ddce2cd2ad5dba1
Author:     rlubke
Date:       2013-07-18 16:26:02 UTC
Link:       

Log Message:
------------
[2.3.x] Fix for https://java.net/jira/browse/GRIZZLY-1547 ;(Enabling 
compression leads to truncation of files > 16384 Bytes)
 - Only called finished() when we're dealing with the last
    HttpContent chunk to ensure we use the same compression
    context across the entire data set vs individually
    compressing each chunk.



Revisions:
----------
1f07e7b7dff8123d6000b2864ddce2cd2ad5dba1


Modified Paths:
---------------
modules/http/src/main/java/org/glassfish/grizzly/http/GZipContentEncoding.java


Diffs:
------
--- 
a/modules/http/src/main/java/org/glassfish/grizzly/http/GZipContentEncoding.java
+++ 
b/modules/http/src/main/java/org/glassfish/grizzly/http/GZipContentEncoding.java
@@ -200,11 +200,12 @@ public class GZipContentEncoding implements 
ContentEncoding {
                 case COMPLETE:
                 case INCOMPLETE: {
                     Buffer encodedBuffer = result.getMessage();
-                    final Buffer finishBuffer = encoder.finish(httpHeader);
-                    encodedBuffer = Buffers.appendBuffers(
-                            connection.getTransport().getMemoryManager(),
-                            encodedBuffer, finishBuffer);
-
+                    if (httpContent.isLast()) {
+                        final Buffer finishBuffer = 
encoder.finish(httpHeader);
+                        encodedBuffer = Buffers.appendBuffers(
+                                connection.getTransport().getMemoryManager(),
+                                encodedBuffer, finishBuffer);
+                    }
                     if (encodedBuffer != null) {
                         httpContent.setContent(encodedBuffer);
                         return httpContent;





[grizzly~git:1f07e7b7] [2.3.x] Fix for https://java.net/jira/browse/GRIZZLY-1547 (Enabling compr

rlubke 07/18/2013
Terms of Use; Privacy Policy; Copyright ©2013-2015 (revision 20150626.29986a4)
 
 
Close
loading
Please Confirm
Close