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 2019/09/09 11:44:52 UTC

[tomcat] 01/02: Simplify

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 0266539eac4cc598971f3488b38fb0fa52bd2a46
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Mon Sep 9 11:35:52 2019 +0100

    Simplify
    
    position is set to:
    pos + 1
    
    Then limit is set to
    position + 9 - pos = pos + 1 + 9 - pos
                       = 1 + 9
                       = 10
---
 java/org/apache/coyote/http11/filters/ChunkedOutputFilter.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/coyote/http11/filters/ChunkedOutputFilter.java b/java/org/apache/coyote/http11/filters/ChunkedOutputFilter.java
index 65bcf39..b382683 100644
--- a/java/org/apache/coyote/http11/filters/ChunkedOutputFilter.java
+++ b/java/org/apache/coyote/http11/filters/ChunkedOutputFilter.java
@@ -106,7 +106,7 @@ public class ChunkedOutputFilter implements OutputFilter {
 
         int pos = calculateChunkHeader(result);
 
-        chunkHeader.position(pos + 1).limit(chunkHeader.position() + 9 - pos);
+        chunkHeader.position(pos + 1).limit(10);
         buffer.doWrite(chunkHeader);
 
         buffer.doWrite(chunk);


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