From: Dean M. B. <mik...@gm...> - 2010-09-09 17:57:02
|
Hi Guys, Just a quick heads up, I've pushed an incremental parser for HTTP responses that I'm building with two birds to hit: 1. Develop a spec-compliant HTTP response message parser that is stateful, space-efficient, and is restartable that will be used in the asynchronous http client implementation. 2. Develop an incremental parser concept which might stand as a good abstraction on its own. #1 is the short term goal, while #2 is the longer term goal. The reason for #2 is similar to the reasoning behind the development of the Message concept as well as the Request and Response concepts: so that it would be easier for us and others to implement compliant, drop-in implementations that model the Message, Request, and Response concepts. The goal for having a suitable incremental parser interface is so that we can generally abstract the client/server implementations enough to just rely on concepts like an IncrementalParser which can be implemented underneath using as many different technologies as possible. I think if we have an implementation of incremental parsers for HTTP, XMPP, SMTP, then that might make a compelling component of the library that would be useful in different kinds of applications -- much like how the URI parser is really useful in many different contexts outside of just cpp-netlib. Thanks guys and I hope this helps. PS. In case you want to pick up where I've left things hanging, please feel free to fork and send in pull requests. I've tried to document the rationale in the test, and will be documenting the rationale for the implementation more as I we go along. The test is in libs/network/test/http_incremental_parser.cpp (in commit http://bit.ly/dmkA9f, the actual file is http://bit.ly/9h61ju). The implementation now is able to at least parse the HTTP version part of a range, and say whether it was successful or whether there are still missing parts, or that the range isn't conforming. -- Dean Michael Berris deanberris.com |