Expected behavior
That all writes via NIOAsyncChannel.output.write are flushed when a connection is closed.
Actual behavior
If I write a large buffer of over 1MB and exit the closure sent to NIOAsyncChannel.executeThenClose immediately the buffer doesn't get flushed.
Here is the related Slack conversation https://swift-open-source.slack.com/archives/C9MMT6VGB/p1713405447642699
Steps to reproduce
- Create HTTP1 server using
NIOAsyncChannel, which returns 1MB for every request
- curl -H "Connection: close" localhost:8888 --output -
SwiftNIO version/commit hash
2.67.0
System & version information
swift-driver version: 1.90.11.1 Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)
Target: arm64-apple-macosx14.0