(tomcat) 01/03: Add additional test

[email protected]
Newsgroups gmane.comp.jakarta.tomcat.devel
Message-ID <[email protected]>
This is an automated email from the ASF dual-hosted git repository.

markt-asf pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 16d687a86e363bc72286065254c9cdb4119b03bc
Author: Mark Thomas <[email protected]>
AuthorDate: Wed Jul 1 09:44:15 2026 +0100

    Add additional test
---
 .../apache/catalina/connector/TestInputBuffer.java | 23 ++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/test/org/apache/catalina/connector/TestInputBuffer.java b/test/org/apache/catalina/connector/TestInputBuffer.java
index 6d40259230..6796005411 100644
--- a/test/org/apache/catalina/connector/TestInputBuffer.java
+++ b/test/org/apache/catalina/connector/TestInputBuffer.java
@@ -79,6 +79,29 @@ public class TestInputBuffer extends TomcatBaseTest {
     }
 
 
+    @Test
+    public void testLargeReadBufSize() throws Exception {
+        Tomcat tomcat = getTomcatInstance();
+        Context root = tomcat.addContext("", TEMP_DIR);
+        Tomcat.addServlet(root, "Echo", new Utf8Echo());
+        root.addServletMappingDecoded("/test", "Echo");
+
+        Assert.assertTrue(tomcat.getConnector().setProperty("socket.appReadBufSize", "10500"));
+
+        tomcat.start();
+
+        Assert.assertTrue(tomcat.getConnector().setProperty("socket.appReadBufSize", "10500"));
+        tomcat.start();
+
+        ByteChunk bc = new ByteChunk();
+        byte[] requestBody = new byte[95000];
+        Arrays.fill(requestBody, (byte) '0');
+        int rc = postUrl(requestBody, "http://localhost:" + getPort() + "/test", bc, null);
+        Assert.assertEquals(HttpServletResponse.SC_OK, rc);
+        Assert.assertEquals(requestBody.length, bc.getLength());
+    }
+
+
     private void doUtf8BodyTest(String description, int[] input, String expected) throws Exception {
 
         byte[] bytes = new byte[input.length];
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.