Skip to content
  • John Thacker's avatar
    HTTP: Speed up chunked Transfer-Encoding on TCP · 13df9b0b
    John Thacker authored and A Wireshark GitLab Utility's avatar A Wireshark GitLab Utility committed
    HTTP/1.1 chunked Transfer-Encoding doesn't have a overall length,
    but requires scanning through variable length chunks to find the
    end. If we determine that additional segments are needed, and
    we have a sequence number (or other identifier) for the message,
    store the position of the last chunk size found.
    
    Use this to start scanning at that same offset when the next
    segment arrives, reducing the algorithm for determining if
    when we have the complete chunked message from O(N^2) to O(N),
    which can be significant on captures with many chunks.
    
    This does most of #14382, reducing the length of time to process
    a file with 2 pass tshark from over 8.5 secs to under 3 seconds
    on my machine. There is still some O(N^2) contribution from the
    reassembly code itself with many small fragments (see #17311).
    
    Other dissectors need some small changes to enable this for
    HTTP over other transport layers. (TLS would be fairly easy and
    is the other important case.)
    13df9b0b