mirror of
https://github.com/apple/swift-nio
synced 2026-11-24 04:37:54 +00:00
Motivation: Once again, we had an extra event loop hop between a channel registration and its activation. Usually this shows up as `EPOLLHUP` but not so for accepted channels. What happened instead is that we had a small race window after we accepted a channel. It was in a state where it was not marked active _yet_ and therefore we'd not read out its data in case we received a `.readEOF`. That usually leads to a stale connection. Fortunately it doesn't happen very often that the client connects, immediately sends some data and then shuts the write end of the socket. Modifications: prevent the event loop hop between registration and activation Result: will always read out the read buffer on .readEOF