You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2026/09/29 18:27:38 UTC
(tomcat) 04/15: Avoid buffering remote WAR uploads of unknown length in memory in the Manager Ant tasks
This is an automated email from the ASF dual-hosted git repository.
rmaucher pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 8284c0f82a5965ccf212b178a1f00955072f50c7
Author: opencode <re...@apache.org>
AuthorDate: Tue Sep 29 19:09:16 2026 +0200
Avoid buffering remote WAR uploads of unknown length in memory in the Manager Ant tasks
---
java/org/apache/catalina/ant/AbstractCatalinaTask.java | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/java/org/apache/catalina/ant/AbstractCatalinaTask.java b/java/org/apache/catalina/ant/AbstractCatalinaTask.java
index 58d078de29..bf20a8ae35 100644
--- a/java/org/apache/catalina/ant/AbstractCatalinaTask.java
+++ b/java/org/apache/catalina/ant/AbstractCatalinaTask.java
@@ -274,6 +274,11 @@ public abstract class AbstractCatalinaTask extends BaseRedirectorHelperTask {
hconn.setRequestProperty("Content-Length", "" + contentLength);
hconn.setFixedLengthStreamingMode(contentLength);
+ } else {
+ // The length is unknown. Use chunked streaming to avoid the
+ // default HttpURLConnection behaviour of buffering the
+ // entire request body in memory.
+ hconn.setChunkedStreamingMode(0);
}
} else {
hconn.setDoOutput(false);
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org