• Martin Blix Grydeland's avatar
    Accurate byte counters · 51176640
    Martin Blix Grydeland authored
    There was a regression from Varnish 4.0 to 4.1, where the response
    bytes was counted as the number of bytes fed to the outgoing write
    vector, rather than the bytes that was actually handed off to the OS'
    socket buffer. This would cause for many cases the complete object
    size counted as transmitted bytes, even though the client hung up the
    connection early.
    
    This patch changes the counters to show the amount of bytes sent as
    reported from the write() system calls rather than the bytes we planned
    and prepared to send. The counters will include any protocol overhead (ie
    chunked encoding in HTTP/1 and the frame headers in HTTP/2).
    
    ESI subrequests will as before in their log transactions report the number
    of bytes it (and any subrequests below it) contributed to the total body
    bytes produced.
    
    Some test cases have been adjusted to account for the new counter behaviour.
    
    Fixes: 2558
    51176640
l00003.vtc 1.9 KB