This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push:
new 0b4b2f8cd2 Remove debug logging. We have not seen the error repeat in
2 years.
0b4b2f8cd2 is described below
commit 0b4b2f8cd24e349ca363c9c3db00eacd52c90237
Author: Mark Thomas <[email protected]>
AuthorDate: Wed Jul 26 14:41:59 2023 +0100
Remove debug logging. We have not seen the error repeat in 2 years.
---
.../apache/coyote/http2/TestCancelledUpload.java | 112 ++++++++++-----------
1 file changed, 52 insertions(+), 60 deletions(-)
diff --git a/test/org/apache/coyote/http2/TestCancelledUpload.java
b/test/org/apache/coyote/http2/TestCancelledUpload.java
index fbe1725c04..e49ea23e29 100644
--- a/test/org/apache/coyote/http2/TestCancelledUpload.java
+++ b/test/org/apache/coyote/http2/TestCancelledUpload.java
@@ -19,8 +19,6 @@ package org.apache.coyote.http2;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
-import java.util.logging.Level;
-import java.util.logging.LogManager;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServletRequest;
@@ -40,72 +38,66 @@ public class TestCancelledUpload extends Http2TestBase {
public void testCancelledRequest() throws Exception {
http2Connect();
-
LogManager.getLogManager().getLogger("org.apache.coyote.http2").setLevel(Level.ALL);
- try {
- ((AbstractHttp11Protocol<?>) http2Protocol.getHttp11Protocol())
- .setAllowedTrailerHeaders(TRAILER_HEADER_NAME);
-
- int bodySize = 8192;
- int bodyCount = 20;
-
- byte[] headersFrameHeader = new byte[9];
- ByteBuffer headersPayload = ByteBuffer.allocate(128);
- byte[] dataFrameHeader = new byte[9];
- ByteBuffer dataPayload = ByteBuffer.allocate(bodySize);
- byte[] trailerFrameHeader = new byte[9];
- ByteBuffer trailerPayload = ByteBuffer.allocate(256);
-
- buildPostRequest(headersFrameHeader, headersPayload, false,
dataFrameHeader, dataPayload, null,
- trailerFrameHeader, trailerPayload, 3);
-
- // Write the headers
- writeFrame(headersFrameHeader, headersPayload);
- // Body
- for (int i = 0; i < bodyCount; i++) {
- writeFrame(dataFrameHeader, dataPayload);
- }
+ ((AbstractHttp11Protocol<?>)
http2Protocol.getHttp11Protocol()).setAllowedTrailerHeaders(TRAILER_HEADER_NAME);
- // Trailers
- writeFrame(trailerFrameHeader, trailerPayload);
-
- // The Server will process the request on a separate thread to the
- // incoming frames.
- // The request processing thread will:
- // - read up to 128 bytes of request body
- // (and issue a window update for bytes read)
- // - write a 403 response with no response body
- // The connection processing thread will:
- // - read the request body until the flow control window is
exhausted
- // - reset the stream if further DATA frames are received
- parser.readFrame();
+ int bodySize = 8192;
+ int bodyCount = 20;
- // Check for reset and exit if found
- if (checkReset()) {
- return;
- }
+ byte[] headersFrameHeader = new byte[9];
+ ByteBuffer headersPayload = ByteBuffer.allocate(128);
+ byte[] dataFrameHeader = new byte[9];
+ ByteBuffer dataPayload = ByteBuffer.allocate(bodySize);
+ byte[] trailerFrameHeader = new byte[9];
+ ByteBuffer trailerPayload = ByteBuffer.allocate(256);
- // Not window update, not reset, must be the headers
- Assert.assertEquals("3-HeadersStart\n" +
"3-Header-[:status]-[403]\n" + "3-Header-[content-length]-[0]\n" +
- "3-Header-[date]-[Wed, 11 Nov 2015 19:18:42 GMT]\n" +
"3-HeadersEnd\n", output.getTrace());
- output.clearTrace();
- parser.readFrame();
+ buildPostRequest(headersFrameHeader, headersPayload, false,
dataFrameHeader, dataPayload, null,
+ trailerFrameHeader, trailerPayload, 3);
- // Check for reset and exit if found
- if (checkReset()) {
- return;
- }
+ // Write the headers
+ writeFrame(headersFrameHeader, headersPayload);
+ // Body
+ for (int i = 0; i < bodyCount; i++) {
+ writeFrame(dataFrameHeader, dataPayload);
+ }
- // Not window update, not reset, must be the response body
- Assert.assertEquals("3-Body-0\n" + "3-EndOfStream\n",
output.getTrace());
- output.clearTrace();
- parser.readFrame();
+ // Trailers
+ writeFrame(trailerFrameHeader, trailerPayload);
+
+ // The Server will process the request on a separate thread to the
+ // incoming frames.
+ // The request processing thread will:
+ // - read up to 128 bytes of request body
+ // (and issue a window update for bytes read)
+ // - write a 403 response with no response body
+ // The connection processing thread will:
+ // - read the request body until the flow control window is exhausted
+ // - reset the stream if further DATA frames are received
+ parser.readFrame();
+
+ // Check for reset and exit if found
+ if (checkReset()) {
+ return;
+ }
- Assert.assertTrue(checkReset());
+ // Not window update, not reset, must be the headers
+ Assert.assertEquals("3-HeadersStart\n" + "3-Header-[:status]-[403]\n"
+ "3-Header-[content-length]-[0]\n" +
+ "3-Header-[date]-[Wed, 11 Nov 2015 19:18:42 GMT]\n" +
"3-HeadersEnd\n", output.getTrace());
+ output.clearTrace();
+ parser.readFrame();
- // If there are any more frames after this, ignore them
- } finally {
-
LogManager.getLogManager().getLogger("org.apache.coyote.http2").setLevel(Level.INFO);
+ // Check for reset and exit if found
+ if (checkReset()) {
+ return;
}
+
+ // Not window update, not reset, must be the response body
+ Assert.assertEquals("3-Body-0\n" + "3-EndOfStream\n",
output.getTrace());
+ output.clearTrace();
+ parser.readFrame();
+
+ Assert.assertTrue(checkReset());
+
+ // If there are any more frames after this, ignore them
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]