[MINOR] stats_dump_errors_to_buffer: use buffer_feed_chunk()

We can simplify the code in the stats functions using buffer_feed_chunk()
instead of buffer_write_chunk(). Let's start with this function. This
patch also fixed an issue where we could dump past the end of the capture
buffer if it is shorter than the captured request.
2 files changed