apple / swift-nio-http2

HTTP/2 support for SwiftNIO
https://swiftpackageindex.com/apple/swift-nio-http2/main/documentation/niohttp2
Apache License 2.0
462 stars 82 forks source link

Support close mode when closing HTTP2StreamChannel #437

Closed gjcairo closed 6 months ago

gjcairo commented 6 months ago

Right now, the close0 implementation of HTTP2StreamChannel doesn't do anything with the close mode: link. We should add support for the different close modes.

Lukasa commented 6 months ago

What would we do with them?

glbrntt commented 6 months ago

I think we looked at our problem the wrong way. The problem being how to close only the inbound stream when using NIOAsyncChannel. At the moment it closes it on channelInactive, channelError and on the ChannelEvent.inputClosed user inbound event.

The first two aren't appropriate so and we made the mistake of thinking "we need ChannelEvent.inputClosed so we need close0 to support close modes". I think we can just fire the user inbound event when we receive a frame with the end stream flag set, which I think makes sense in this situation.