Skip to content

Commit

Permalink
Set closed state on inputClosed
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-fowler committed Nov 6, 2024
1 parent 8130172 commit 62a4861
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/HummingbirdCore/Server/HTTP/HTTP1Channel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public struct HTTP1Channel: ServerChildChannel, HTTPChannelHandler {

/// HTTP1Channel configuration
public struct Configuration: Sendable {
/// Additional channel handlers to add to channel after HTTP part decoding and before HTTP request processing
/// Additional channel handlers to add to channel pipeline after HTTP part decoding and before HTTP request handling
public var additionalChannelHandlers: @Sendable () -> [any RemovableChannelHandler]
/// Time before closing an idle channel
public var idleTimeout: TimeAmount?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,12 @@ extension HTTP2ServerConnectionManager {
mutating func inputClosed() -> InputClosedResult {
switch self.state {
case .active(let activeState):
self.state = .closed
return .closeWithGoAway(lastStreamId: activeState.lastStreamId)

case .closing(let closeState):
if closeState.sentSecondGoAway {
self.state = .closed
return .close
} else {
return .closeWithGoAway(lastStreamId: closeState.lastStreamId)
Expand Down

0 comments on commit 62a4861

Please sign in to comment.