From 8130172b0eb47025fc9a777f5053632ce3463802 Mon Sep 17 00:00:00 2001 From: Adam Fowler Date: Sun, 3 Nov 2024 21:44:05 +0000 Subject: [PATCH] Updated comments to answer some PR comments --- Sources/HummingbirdHTTP2/HTTP2Channel.swift | 6 +++--- .../HTTP2ServerConnectionManager+StateMachine.swift | 2 +- Sources/HummingbirdHTTP2/HTTP2StreamChannel.swift | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Sources/HummingbirdHTTP2/HTTP2Channel.swift b/Sources/HummingbirdHTTP2/HTTP2Channel.swift index 1b7077b5..15eff80e 100644 --- a/Sources/HummingbirdHTTP2/HTTP2Channel.swift +++ b/Sources/HummingbirdHTTP2/HTTP2Channel.swift @@ -38,7 +38,7 @@ public struct HTTP2UpgradeChannel: ServerChildChannel { public struct Configuration: Sendable { /// Idle timeout, how long connection is kept idle before closing public var idleTimeout: Duration? - /// Maximum amount of time to wait before all streams are closed after second GOAWAY + /// Maximum amount of time to wait for client response before all streams are closed after second GOAWAY has been sent public var gracefulCloseTimeout: Duration? /// Maximum amount of time a connection can be open public var maxAgeTimeout: Duration? @@ -48,7 +48,7 @@ public struct HTTP2UpgradeChannel: ServerChildChannel { /// Initialize HTTP2UpgradeChannel.Configuration /// - Parameters: /// - idleTimeout: How long connection is kept idle before closing - /// - maxGraceCloseTimeout: Maximum amount of time to wait before all streams are closed after second GOAWAY + /// - maxGraceCloseTimeout: Maximum amount of time to wait for client response before all streams are closed after second GOAWAY /// - streamConfiguration: Configuration applieds to HTTP2 stream channels public init( idleTimeout: Duration? = nil, @@ -65,7 +65,7 @@ public struct HTTP2UpgradeChannel: ServerChildChannel { private let sslContext: NIOSSLContext private let http1: HTTP1Channel private let http2Stream: HTTP2StreamChannel - let configuration: Configuration + public let configuration: Configuration /// Initialize HTTP2Channel /// - Parameters: diff --git a/Sources/HummingbirdHTTP2/HTTP2ServerConnectionManager+StateMachine.swift b/Sources/HummingbirdHTTP2/HTTP2ServerConnectionManager+StateMachine.swift index 57e9c79b..655ed285 100644 --- a/Sources/HummingbirdHTTP2/HTTP2ServerConnectionManager+StateMachine.swift +++ b/Sources/HummingbirdHTTP2/HTTP2ServerConnectionManager+StateMachine.swift @@ -94,7 +94,7 @@ extension HTTP2ServerConnectionManager { enum ReceivedPingResult { case sendPingAck(pingData: HTTP2PingData) - case enhanceYouCalmAndClose(lastStreamId: HTTP2StreamID) + case enhanceYouCalmAndClose(lastStreamId: HTTP2StreamID) // Sent when client sends too many pings case none } diff --git a/Sources/HummingbirdHTTP2/HTTP2StreamChannel.swift b/Sources/HummingbirdHTTP2/HTTP2StreamChannel.swift index cc44a3d9..95be0008 100644 --- a/Sources/HummingbirdHTTP2/HTTP2StreamChannel.swift +++ b/Sources/HummingbirdHTTP2/HTTP2StreamChannel.swift @@ -19,15 +19,15 @@ import NIOCore import NIOHTTPTypes import NIOHTTPTypesHTTP2 -/// Child channel for processing HTTP1 +/// HTTP2 Child channel for processing an HTTP2 stream struct HTTP2StreamChannel: ServerChildChannel, HTTPChannelHandler { typealias Value = NIOAsyncChannel typealias Configuration = HTTP1Channel.Configuration - /// Initialize HTTP1Channel + /// Initialize HTTP2StreamChannel /// - Parameters: /// - responder: Function returning a HTTP response for a HTTP request - /// - configuration: HTTP1 channel configuration + /// - configuration: HTTP2 stream channel configuration init( responder: @escaping HTTPChannelHandler.Responder, configuration: Configuration = .init() @@ -36,7 +36,7 @@ struct HTTP2StreamChannel: ServerChildChannel, HTTPChannelHandler { self.responder = responder } - /// Setup child channel for HTTP1 + /// Setup child channel for HTTP2 stream /// - Parameters: /// - channel: Child channel /// - logger: Logger used during setup