Metaswitch/libevhtp — pull request #2 by AlexHockey (2014-11-27 12:09:58+00:00)
Title: [Reviewer: Mike] Expose serialized message headers, IP addresses and ports from libevhtp

Mike, please could you review this PR as part of adding logging of full HTTP messages to SAS, along with local and remote IP addresses and ports.

There is one change from the design you reviewed. I was intending to have one evbuffer on the request object (`evhtp_request_s`), and write received data directly to it. However libevhtp does not create the request until the parser has fired it's "on new request" callback. As such I now buffer up data on the connection object, and move it to the request when the parser fires the "on header complete" callback. Because of how evbuffers work this doesn't involve any additional memory copies.

I have tested this live (see the test plan I sent round yesterday). I have some specific tests to confirm we deal with segmentation properly.