natsys/tempesta — pull request #34 by vdmit11 (2014-12-04 19:16:23+00:00)
Title: fix HTTP header parsing

Fixes the following problems:

1. `TfwHttpHdrTbl->off` is not properly initialized.
That causes corruptions between special and common headers during the parsing.

2. `TfwHttpHdrTbl->off` is incremented when either special or common header is stored.
It should be incremented only for common headers because special headers live by ther own constant offsets in the table.

3. Invalid header length passed to `__store_header()`.
Only lenght of a value is passed (but should be length of key+value).
Tails are simply cropped because of this.
Actually this fix is not quite finished, during the review we decided to store special/common headers in different forms (for performance purposes).
So this is just a quick and dirty fix, and a better solution is coming (in a separate branch).

Also this change introduces a unit test suite for the HTTP parser.
Currently there is just one test for the headers issue, but in future we expect this suite to be hot since the parser is should be tested carefully.