mirror of
https://github.com/apple/swift-nio
synced 2026-11-27 05:04:22 +00:00
Motivation: The pipelining handler made the assumption that `channelRead` is never called recursively. That's mostly true but there is at least one situation where that's not true: - pipelining handler seen a response .end and delivers a .head (which is done in `channelRead`) - a handler further down stream writes and flushes some response data - the flushes fail which leads to us draining the receive buffer - if the receive buffer contained more requests, the pipelining handler's `channelRead` is called again (recursively) The net result of that was that the new request parts from the receive buffer would now jump the queue and go through the channel pipeline next, before other already buffered messages. Modifications: made the pipelining handler buffer if a `channelRead` comes in from the pipeline and there is already at least one message buffered. Result: the ordering of the incoming messages should now be respected which is very important...