mirror of
https://github.com/apple/swift-nio-ssl
synced 2026-11-22 04:30:44 +00:00
## Summary - Discard buffered actions when `NIOSSLHandler.flush` runs after the handler reaches `.closed`, failing pending write promises with `ChannelError.ioOnClosedChannel`. - Add regression coverage for handshake EOF, remote half closure, and flush-before-close behavior. ## Motivation During handshake failure, a downstream `errorCaught` callback can flush a write that TLS buffered before closing. The closed handler cannot encode that write, so `doUnbufferActions` repeats until its no-progress assertion aborts a debug build. The new closed-state path avoids entering that loop. ## Testing - Before the fix, the full-closure and half-closure regressions each reproduced the `doUnbufferActions(context:) looped too many times` assertion. - After the fix, `swift test --jobs 4` passed all 344 tests using Swift 6.4 on Linux arm64. - macOS execution has not been verified for this change. Fixes #609