You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2020/09/07 14:34:07 UTC
[tomcat] branch 8.5.x updated (027071c -> 6ff5ddf)
This is an automated email from the ASF dual-hosted git repository.
markt pushed a change to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git.
from 027071c Better error for empty header name
new a6a47dc Back-port NPE fix 8.5.x where trailer fields are handled differently.
new 6ff5ddf Fixing flow control for zero length padding introduced an edge case
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
java/org/apache/coyote/http2/Stream.java | 10 ++++++++--
test/org/apache/coyote/http2/TestCancelledUpload.java | 14 ++++++++++++--
2 files changed, 20 insertions(+), 4 deletions(-)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[tomcat] 02/02: Fixing flow control for zero length padding
introduced an edge case
Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 6ff5ddf508418ad76094f15279ad59fcfd0ce134
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Mon Sep 7 15:30:41 2020 +0100
Fixing flow control for zero length padding introduced an edge case
Again, spotted by Travis CI
---
test/org/apache/coyote/http2/TestCancelledUpload.java | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/test/org/apache/coyote/http2/TestCancelledUpload.java b/test/org/apache/coyote/http2/TestCancelledUpload.java
index fa798c1..2a5b762 100644
--- a/test/org/apache/coyote/http2/TestCancelledUpload.java
+++ b/test/org/apache/coyote/http2/TestCancelledUpload.java
@@ -78,12 +78,16 @@ public class TestCancelledUpload extends Http2TestBase {
return;
}
- // Validate any WindowSize frames (always arrive in pairs)
+ // Validate any WindowSize frames. Usually arrive in pairs. Depending on
+ // timing, can see a reset rather than than stream update.
while (output.getTrace().startsWith("0-WindowSize-[")) {
String trace = output.getTrace();
int size = Integer.parseInt(trace.substring(14, trace.length() - 2));
output.clearTrace();
parser.readFrame(true);
+ if (output.getTrace().startsWith("3-RST-[3]\n")) {
+ return;
+ }
Assert.assertEquals("3-WindowSize-[" + size + "]\n", output.getTrace());
output.clearTrace();
parser.readFrame(true);
@@ -118,13 +122,19 @@ public class TestCancelledUpload extends Http2TestBase {
// There must be a reset. There may be some WindowSize frames
parser.readFrame(true);
- // Validate any WindowSize frames (always arrive in pairs)
+ // Validate any WindowSize frames. Usually arrive in pairs. Depending on
+ // timing, can see a reset rather than than stream update.
while (output.getTrace().startsWith("0-WindowSize-[")) {
String trace = output.getTrace();
int size = Integer.parseInt(trace.substring(14, trace.length() - 2));
output.clearTrace();
parser.readFrame(true);
+ if (output.getTrace().startsWith("3-RST-[3]\n")) {
+ return;
+ }
Assert.assertEquals("3-WindowSize-[" + size + "]\n", output.getTrace());
+ output.clearTrace();
+ parser.readFrame(true);
}
// This should be the reset
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[tomcat] 01/02: Back-port NPE fix 8.5.x where trailer fields are
handled differently.
Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit a6a47dc7caf95fd076e58ed0b34f3a463e302623
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Mon Sep 7 15:00:59 2020 +0100
Back-port NPE fix 8.5.x where trailer fields are handled differently.
---
java/org/apache/coyote/http2/Stream.java | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/java/org/apache/coyote/http2/Stream.java b/java/org/apache/coyote/http2/Stream.java
index 116bbae..46719da 100644
--- a/java/org/apache/coyote/http2/Stream.java
+++ b/java/org/apache/coyote/http2/Stream.java
@@ -476,8 +476,14 @@ public class Stream extends AbstractStream implements HeaderEmitter {
"stream.header.unknownPseudoHeader", getConnectionId(), getIdentifier(),
name), Http2Error.PROTOCOL_ERROR, getIdAsInt());
}
- // Assume other HTTP header
- coyoteRequest.getMimeHeaders().addValue(name).setString(value);
+
+ // Avoid NPE if Stream has been closed on Stream specific thread
+ Request coyoteRequest = this.coyoteRequest;
+ if (coyoteRequest != null) {
+ // HTTP/2 headers are already always lower case
+ // In 8.5.x trailer headers are added to headers collection.
+ coyoteRequest.getMimeHeaders().addValue(name).setString(value);
+ }
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org