apple / swift-nio

Event-driven network application framework for high performance protocol servers & clients, non-blocking.
https://swiftpackageindex.com/apple/swift-nio/documentation
Apache License 2.0
7.85k stars 633 forks source link

Close channel during upgrade, if client closes input #2756

Open adam-fowler opened 1 week ago

adam-fowler commented 1 week ago

Check for half closure during server upgrade and close channel if client closes the channel

Motivation:

This is to fix #2742

Modifications:

Add userInboundEventTriggered function to NIOTypedHTTPServerProtocolUpgrader which checks for ChannelEvent.inputClosed

Result:

Negotiation future now errors when client closes the connection instead of never completing