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
The following commit(s) were added to refs/heads/8.5.x by this push: new 69bbf30 Refactor: remove unused parameter, separate frame create and frame write 69bbf30 is described below commit 69bbf3072ac8646ea4a81c1eeebe10e6675cc386 Author: Mark Thomas <ma...@apache.org> AuthorDate: Thu Oct 1 10:18:01 2020 +0100 Refactor: remove unused parameter, separate frame create and frame write --- test/org/apache/coyote/http2/Http2TestBase.java | 18 ++++++++---------- test/org/apache/coyote/http2/TestHttp2Section_6_8.java | 2 +- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/test/org/apache/coyote/http2/Http2TestBase.java b/test/org/apache/coyote/http2/Http2TestBase.java index ce61d4b..9b79f4b 100644 --- a/test/org/apache/coyote/http2/Http2TestBase.java +++ b/test/org/apache/coyote/http2/Http2TestBase.java @@ -803,14 +803,9 @@ public abstract class Http2TestBase extends TomcatBaseTest { } - void sendGoaway(int streamId, int lastStreamId, long errorCode, byte[] debug) - throws IOException { + byte[] buildGoaway(int streamId, int lastStreamId, long errorCode) { byte[] goawayFrame = new byte[17]; - int len = 8; - if (debug != null) { - len += debug.length; - } - ByteUtil.setThreeBytes(goawayFrame, 0, len); + ByteUtil.setThreeBytes(goawayFrame, 0, 8); // Type goawayFrame[3] = FrameType.GOAWAY.getIdByte(); // No flags @@ -819,10 +814,13 @@ public abstract class Http2TestBase extends TomcatBaseTest { // Last stream ByteUtil.set31Bits(goawayFrame, 9, lastStreamId); ByteUtil.setFourBytes(goawayFrame, 13, errorCode); + return goawayFrame; + } + + + void sendGoaway(int streamId, int lastStreamId, long errorCode) throws IOException { + byte[] goawayFrame = buildGoaway(streamId, lastStreamId, errorCode); os.write(goawayFrame); - if (debug != null && debug.length > 0) { - os.write(debug); - } os.flush(); } diff --git a/test/org/apache/coyote/http2/TestHttp2Section_6_8.java b/test/org/apache/coyote/http2/TestHttp2Section_6_8.java index c43a0b5..b80b1a9 100644 --- a/test/org/apache/coyote/http2/TestHttp2Section_6_8.java +++ b/test/org/apache/coyote/http2/TestHttp2Section_6_8.java @@ -76,7 +76,7 @@ public class TestHttp2Section_6_8 extends Http2TestBase { // HTTP2 upgrade http2Connect(); - sendGoaway(1, 1, Http2Error.NO_ERROR.getCode(), null); + sendGoaway(1, 1, Http2Error.NO_ERROR.getCode()); handleGoAwayResponse(1); } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org