Skip to content

Commit 653858d

Browse files
committed
Tolerate multiple calls to shutdown()
1 parent 3b3b5d0 commit 653858d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Sources/AsyncHTTPClient/ConnectionPool/HTTP2/HTTP2Connection.swift

+4-3
Original file line numberDiff line numberDiff line change
@@ -279,10 +279,11 @@ final class HTTP2Connection {
279279
// are closed.
280280
self.channel.triggerUserOutboundEvent(HTTPConnectionEvent.shutdownRequested, promise: nil)
281281

282-
case .closed:
283-
// we are already closed and we need to tolerate this
282+
case .closed, .closing:
283+
// we are already closing/closed and we need to tolerate this
284284
break
285-
case .initialized, .closing:
285+
286+
case .initialized:
286287
preconditionFailure("invalid state \(self.state)")
287288
}
288289
}

0 commit comments

Comments
 (0)