This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 10.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.0.x by this push: new 50855e97fb fix Bug 66084 Correctly calculate bytes written 50855e97fb is described below commit 50855e97fb98b75fd466ea0b37ceff070512a9d6 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 d7a6783ea3..d5e8efd9f4 100644 --- a/java/org/apache/catalina/connector/OutputBuffer.java +++ b/java/org/apache/catalina/connector/OutputBuffer.java @@ -403,8 +403,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 e19eb5a48e..d6d1845bbf 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -126,6 +126,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