mirror of
https://github.com/apple/swift-nio
synced 2026-11-24 04:37:54 +00:00
Motivation: We need to ensure we correctly guard against re-entrancy for all cases. Also we did not correctly ensure we forward pending data after removal which could lead to missing data after upgrades. Modifications: - pause the parser when we need to callout to the pipeline and so ensure we never fire events throught the pipeline while in callbacks of http_parser - correctly forward any pending bytes if an upgrade happened when the decoder is removed - Ensure HTTPUpgradeHandler only remove decoder after the full request is received - Add testcase provided by @weissi Result: Correctly handle upgrades and pending data. Fixes https://github.com/apple/swift-nio/issues/422.