Files
Goutam Adwant 15e0b9e495 Avoid flushing buffered writes on closed TLS channels (#610)
## 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
2026-10-12 10:33:56 +01:00
..