Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix possible header / URI corruption when discardReadBytes() is calle… #385

Merged

Commits on May 4, 2018

  1. Fix possible header / URI corruption when discardReadBytes() is calle…

    …d in HTTPDecoder
    
    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).
    normanmaurer committed May 4, 2018
    Configuration menu
    Copy the full SHA
    be9cd2f View commit details
    Browse the repository at this point in the history