This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push:
new 0e4cf65 Refactor stream reset when cancelling in an progress upload
0e4cf65 is described below
commit 0e4cf655a80962af9ce456c5d41211dca1b1ea00
Author: Mark Thomas <[email protected]>
AuthorDate: Thu Mar 11 10:29:21 2021 +0000
Refactor stream reset when cancelling in an progress upload
Using the pre-existing method means better error handling if the RST
frame fails and better logging.
---
java/org/apache/coyote/http2/StreamProcessor.java | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/java/org/apache/coyote/http2/StreamProcessor.java
b/java/org/apache/coyote/http2/StreamProcessor.java
index 45bce39..2e757eb 100644
--- a/java/org/apache/coyote/http2/StreamProcessor.java
+++ b/java/org/apache/coyote/http2/StreamProcessor.java
@@ -464,7 +464,7 @@ class StreamProcessor extends AbstractProcessor {
}
- private void endRequest() throws IOException {
+ private void endRequest() {
if (!stream.isInputFinished() && getErrorState().isIoAllowed()) {
if (handler.hasAsyncIO() && !stream.isContentLengthInconsistent())
{
// Need an additional checks for asyncIO as the end of stream
@@ -477,12 +477,11 @@ class StreamProcessor extends AbstractProcessor {
// The request has been processed but the request body has not been
// fully read. This typically occurs when Tomcat rejects an upload
// of some form (e.g. PUT or POST). Need to tell the client not to
- // send any more data but only if a reset has not already been
- // triggered.
+ // send any more data on this stream (reset).
StreamException se = new StreamException(
sm.getString("streamProcessor.cancel",
stream.getConnectionId(),
stream.getIdAsString()), Http2Error.CANCEL,
stream.getIdAsInt());
- handler.sendStreamReset(se);
+ stream.close(se);
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]