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 27934bf9da fix Bug 66084 Correctly calculate bytes written 27934bf9da is described below commit 27934bf9da44e6d43cb87f877c24c64b23b0670b Author: lihan <aooo...@gmail.com> AuthorDate: Tue May 24 11:20:44 2022 +0800 fix Bug 66084 Correctly calculate bytes written https://bz.apache.org/bugzilla/show_bug.cgi?id=66084 --- java/org/apache/catalina/connector/OutputBuffer.java | 3 ++- webapps/docs/changelog.xml | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/java/org/apache/catalina/connector/OutputBuffer.java b/java/org/apache/catalina/connector/OutputBuffer.java index 2ee976bbf3..b6ddb249e3 100644 --- a/java/org/apache/catalina/connector/OutputBuffer.java +++ b/java/org/apache/catalina/connector/OutputBuffer.java @@ -421,8 +421,9 @@ public class OutputBuffer extends Writer { return; } + int remaining = from.remaining(); append(from); - bytesWritten += from.remaining(); + bytesWritten += remaining; // if called from within flush(), then immediately flush // remaining bytes diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 54a9825630..13860f4258 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -122,6 +122,14 @@ </fix> </changelog> </subsection> + <subsection name="Coyote"> + <changelog> + <fix> + <bug>66084</bug>: Correctly calculate bytes written to a response. Pull + request <pr>516</pr> provided by aooohan HanLi. (markt) + </fix> + </changelog> + </subsection> <subsection name="Jasper"> <changelog> <fix> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org