This is an automated email from the ASF dual-hosted git repository.
markt-asf pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push:
new e625ceab30 Better error reporting
e625ceab30 is described below
commit e625ceab30493a6d6d138590715f9e5667be9637
Author: Mark Thomas <[email protected]>
AuthorDate: Mon Oct 26 23:06:50 2026 +0000
Better error reporting
---
java/org/apache/coyote/http2/Http2AsyncParser.java | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/java/org/apache/coyote/http2/Http2AsyncParser.java
b/java/org/apache/coyote/http2/Http2AsyncParser.java
index 5274374d0d..d0a707ee6e 100644
--- a/java/org/apache/coyote/http2/Http2AsyncParser.java
+++ b/java/org/apache/coyote/http2/Http2AsyncParser.java
@@ -123,8 +123,12 @@ class Http2AsyncParser extends Http2Parser {
// Finish processing the connection
upgradeHandler.processConnectionCallback(webConnection,
stream);
} else {
- upgradeHandler
- .closeConnection(new
ConnectionException(error.getMessage(), Http2Error.PROTOCOL_ERROR, error));
+ /*
+ * Use the error code of the HTTP/2 error, if there is one, so
that the client is told why the
+ * connection is being closed.
+ */
+ upgradeHandler.closeConnection(error instanceof Http2Exception
http2Exception ? http2Exception :
+ new ConnectionException(error.getMessage(),
Http2Error.PROTOCOL_ERROR, error));
}
// Continue reading frames
upgradeHandler.upgradeDispatch(SocketEvent.OPEN_READ);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]