From a89e8ae4e0928026dfbab356dc8bf1ca33e1bc95 Mon Sep 17 00:00:00 2001 From: tom doron Date: Wed, 16 Mar 2022 20:00:15 -0700 Subject: [PATCH] fix code soundness check motivation: code should be sound! changes: * update one case of inappropriate langauge * update header years check regex --- Sources/NIOHTTP2/HTTP2FrameParser.swift | 4 ++-- scripts/soundness.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/NIOHTTP2/HTTP2FrameParser.swift b/Sources/NIOHTTP2/HTTP2FrameParser.swift index b792684..712e592 100644 --- a/Sources/NIOHTTP2/HTTP2FrameParser.swift +++ b/Sources/NIOHTTP2/HTTP2FrameParser.swift @@ -125,7 +125,7 @@ struct HTTP2FrameDecoder { // There needs to be at least the padding length byte, so the minimum frame size is 1. throw InternalError.codecError(code: .protocolError) } - + return .awaitingPaddingLengthByte( AwaitingPaddingLengthByteParserState(fromAccumulatingFrameHeader: self, frameHeader: header) ) @@ -363,7 +363,7 @@ struct HTTP2FrameDecoder { /// In this state if we succesfully move forward at all we'll produce a DATA frame, as /// well as a new target state. mutating func process() throws -> ProcessResult? { - // Sanity checking: the padded flag should be gone. + // Making sure the padded flag should be gone. assert(!self.header.flags.contains(.padded)) let payloadSize = self.remainingByteCount - (self.expectedPadding ?? 0) diff --git a/scripts/soundness.sh b/scripts/soundness.sh index 8ddbbf9..28a9f52 100755 --- a/scripts/soundness.sh +++ b/scripts/soundness.sh @@ -18,7 +18,7 @@ here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" function replace_acceptable_years() { # this needs to replace all acceptable forms with 'YEARS' - sed -e 's/20[12][78901]-20[12][8901]/YEARS/g' -e 's/2019/YEARS/g' -e 's/2020/YEARS/g' -e 's/2021/YEARS/g' + sed -e 's/20[12][78901]-20[12][89012]/YEARS/' -e 's/20[12][89012]/YEARS/' } printf "=> Checking linux tests... "