Skip to content

Commit a3e0241

Browse files
committed
Add additional test
1 parent d44d90e commit a3e0241

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

test/org/apache/catalina/connector/TestInputBuffer.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,29 @@ public void testBug60400() throws Exception {
7979
}
8080

8181

82+
@Test
83+
public void testLargeReadBufSize() throws Exception {
84+
Tomcat tomcat = getTomcatInstance();
85+
Context root = tomcat.addContext("", TEMP_DIR);
86+
Tomcat.addServlet(root, "Echo", new Utf8Echo());
87+
root.addServletMappingDecoded("/test", "Echo");
88+
89+
Assert.assertTrue(tomcat.getConnector().setProperty("socket.appReadBufSize", "10500"));
90+
91+
tomcat.start();
92+
93+
Assert.assertTrue(tomcat.getConnector().setProperty("socket.appReadBufSize", "10500"));
94+
tomcat.start();
95+
96+
ByteChunk bc = new ByteChunk();
97+
byte[] requestBody = new byte[95000];
98+
Arrays.fill(requestBody, (byte) '0');
99+
int rc = postUrl(requestBody, "http://localhost:" + getPort() + "/test", bc, null);
100+
Assert.assertEquals(HttpServletResponse.SC_OK, rc);
101+
Assert.assertEquals(requestBody.length, bc.getLength());
102+
}
103+
104+
82105
private void doUtf8BodyTest(String description, int[] input, String expected) throws Exception {
83106

84107
byte[] bytes = new byte[input.length];

0 commit comments

Comments
 (0)