mirror of
https://github.com/apple/swift-nio-http2
synced 2026-11-23 04:34:24 +00:00
Strictly speaking, a `close` operation can't really fail (except when the closing mode isn't supported or the channel is already closed). Even if an error is encountered while closing a channel, or if an error caused the channel to be closed, the end result is the same: the channel will be closed. In this case in particular, when streams are closed from the client (i.e. by sending a RST_STREAM frame) the `HTTP2StreamChannel` would fail the channel's `closeFuture`. This isn't appropriate however, as the channel is successfully closed. This change stops failing the stream channel's `closeFuture`. Instead, if the close happens uncleanly, the error will be fired down the pipeline and the `close` method's promise will be failed.