perf(http): changes http parsing to use httparse crate
httparse is a http1 stateless push parser. This not only speeds up parsing right now with sync io, but will also be useful for when we get async io, since it's push based instead of pull. BREAKING CHANGE: Several public functions and types in the `http` module have been removed. They have been replaced with 2 methods that handle all of the http1 parsing.
This commit is contained in:
		| @@ -2,6 +2,7 @@ | ||||
| use std::fmt; | ||||
| use std::str::FromStr; | ||||
|  | ||||
| use error::HttpError; | ||||
| use self::Method::{Options, Get, Post, Put, Delete, Head, Trace, Connect, Patch, | ||||
|                    Extension}; | ||||
|  | ||||
| @@ -68,10 +69,10 @@ impl Method { | ||||
| } | ||||
|  | ||||
| impl FromStr for Method { | ||||
|     type Err = (); | ||||
|     fn from_str(s: &str) -> Result<Method, ()> { | ||||
|     type Err = HttpError; | ||||
|     fn from_str(s: &str) -> Result<Method, HttpError> { | ||||
|         if s == "" { | ||||
|             Err(()) | ||||
|             Err(HttpError::HttpMethodError) | ||||
|         } else { | ||||
|             Ok(match s { | ||||
|                 "OPTIONS" => Options, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user