[squid-dev] [PATCH] HTTP Parser upgrade

Amos Jeffries squid3 at treenet.co.nz
Sat Oct 11 20:17:47 UTC 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Minor chages since the last patch.

 * updates to cope with trunk changes.

 * some RFC 7230 compliance polish

Amos

On 7/06/2014 4:55 a.m., Amos Jeffries wrote:
> Latest version of the Parser-NG project branch. Since last message
> I have dropped the copy-constructor related pieces.
> 
> Polygraph testing on the branch showed almost no performance
> impact (+0.04ms/req, -0.03% request rate). Nevertheless a half
> dozen points of added memory reallocate or data copy are marked for
> future removal as the Parser-NG and SBuf improvements continue.
> 
> Coadvisor testing of these changes shows a gain of 3 compliance
> cases for HTTPbis tests and no unexpected regressions against RFC
> 2616 (one HTTPbis gain is claimed as a RFC2616 regression by
> coadvisor still).
> 
> 
> To recap, this project so far:
> 
> 
> Rename the HttpParser class as Http1::RequestParser and move it
> into the Http::One:: namespace. A base Http1::Parser class is also
> added from which Http1::ReplyParser will also be created in future
> work.
> 
> The parser API - is updated to process both the request-line and
> HTTP mime headers, returning a incomplete parse result until the
> entire header portion of the message has been received. - now
> contains accessor methods for retrieving the method, URI, protocol,
> mime headers block as separate SBuf and some metrics about those. -
> the old request_offsets structure and similar offset details
> internal to the parsing are no longer exposed.
> 
> The parser is now incremental. A parser object must be created (or 
> clean() method called) for each new message. Code using the parser 
> should pass their I/O buffer to the parse(SBuf&) method and
> retrieve an updated copy of it afterwards via the remaining()
> method.
> 
> Much of the code from client_side.cc parseHttpRequest() and also
> the header-field code from mime_headers.cc has been moved into the
> parser classes. The client-side code now simply runs the main
> parse() method then uses its accessors to retrieve and process the
> parse results if it returns success.
> 
> The getHeaderField() method imported from mime_headers.cc has been 
> converted to simpler logics based on Tokenizer class and resolving
> a number of bugs in its matching output.
> 
> A unit test for incremental parsing has been added to
> testHttp1Parser.
> 
> The HttpRequestMethod class is moved into the Http namespace and 
> library to reduce dependencies on the parser class outside the
> library.
> 
> The HttpHeader API has been tweaked slighty to accept start+length
> pair instead of start/end pointers.
> 
> Amos
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (MingW32)

iQEcBAEBAgAGBQJUOZBqAAoJELJo5wb/XPRjp9UIAJ2X/OvVWzIN16v+0I/fwV8w
oQtGeBmeDYkg0gTYqOitqeuAySNT7Wgtqjk54wYu8jW92ZZvLPX6JgeEwlsn2iUf
Hv1xp2Nsf8jxbar2bMT3pDgQ0704ys9jvnomPyNiMI4gvlvRRDIwpa8uPTGPA/M5
CHkJkEBy3uE94QTI04aPFL5/jQh9HmZDn4nR1f72jL2IbVg3Dm2x8sg9z0rfLu4l
T8wScUhU+BuhVsMZdhQsjcELtmRym0/EGwq7Xi9gAdNetCHD3xTS3Z7xEl9GhzaW
+xKdO1vbDz1GSLW8X1HBDwIRSMkgxEepTfeOdN/ZEKYUKMRfmNYpvdGcYdOXY80=
=CWj7
-----END PGP SIGNATURE-----


More information about the squid-dev mailing list