mirror of
https://github.com/apple/swift-nio
synced 2026-11-24 04:37:54 +00:00
Motivation: When discardReadBytes() was called and we still did not pass the Head to the user it was quite possible that the headers / URI could be corrupted as the stored readerIndex did not matchup anymore. Modifications: - Override most of the functionality of ByteToMessageDecoder in HTTPDecoder to better work with the provided state machine of http_parser - Remove allocations by removing the pendingInOut Array as its not needed anymore. - Add guards against re-entrance calls - Add unit test that shows that everything works as expected now. Result: Fixed bug and reduced allocations (8% - 10% perf win).