Parse HTTP requests, cleanup the code.

--HG--
extra : rebase_source : 6b35fbf55fc9fe65d7f033620670bb210928e9b4