From: Alex O. <al...@gm...> - 2007-12-11 08:14:29
|
Hello all Not directly related to the pion http parser i had looked into protocol/http/impl/request.hpp and had seen, that it include URI parser. i think, that it better to implement URI parser in their own namespace, as it could be used not only in http parsing, but also in other places. Also, may be it will be useful during implementation - may be not hard code "HTTP" protocol name in parser, but specify it as template parameter? I suggest this, as some other protocols (such as ICAP), use the same structure as HTTP, but different protocol name P.S. i has almost working http request/response parsers, but i has some problems with mixing boost::spirit + std::multimap. I use following structures to hold information about request/response (and corresponding parsers): struct Version { std::string protocol; unsigned int major; unsigned int minor; }; struct Common { Version version; typedef std::multimap<std::string,std::string> headers_t; headers_t headers; std::string body; // may be will replaced with vector<char> } ; struct Request : public Common { URI url; std::string command; } ; struct Response : public Common { std::string textStatus; uint16_t intStatus; } ; -- With best wishes, Alex Ott, MBA http://alexott.blogspot.com/ http://alexott-ru.blogspot.com/ http://content-filtering.blogspot.com/ http://xtalk.msk.su/~ott/ |