mirror of
https://github.com/apple/swift-nio
synced 2026-11-30 05:28:44 +00:00
Motivation: Currently our HTTP server almost always just assumes that keep-alive is enabled. It really shouldn't, it should validate more carefully. Additionally, it mishandles TCP half-close in a way that breaks with netcat. Modifications: Added keep-alive tracking to all handlers and ensured that connections will be closed after a response to a keep-alive request has been sent. Also add support for handling TCP half-close. Result: Non-keep-alive connections will be closed by the server in all cases. Half-closed connections will be appropriately managed.