mirror of
https://github.com/apple/swift-nio
synced 2026-11-25 04:47:49 +00:00
Motivation: The old HTTP parser tried to convert `http_parser` to a one-shot parser by pausing it constantly. That was done to be resilient against re-entrancy. But now, we have the new `ByteToMessageDecoder` which protects against that so HTTP decoder can just become a real `ByteToMessageDecoder`. It also serves as a great testbed for `ByteToMessageDecoder`. Modifications: - make the HTTP decoder a `ByteToMessageDecoder` - refactor the implementation Result: cleaner code, more use of `ByteToMessageDecoder`