feat(lib): add support to disable tokio-proto internals

For now, this adds `client::Config::no_proto`, `server::Http::no_proto`,
and `server::Server::no_proto` to skip tokio-proto implementations, and
use an internal dispatch system instead.

`Http::no_proto` is similar to `Http::bind_connection`, but returns a
`Connection` that is a `Future` to drive HTTP with the provided service.
Any errors prior to parsing a request, and after delivering a response
(but before flush the response body) will be returned from this future.

See #1342 for more.
This commit is contained in:
Sean McArthur
2017-10-02 15:05:40 -07:00
parent 8153cfaebf
commit f7532b71d1
14 changed files with 1040 additions and 155 deletions

View File

@@ -132,6 +132,10 @@ impl Http1Transaction for ServerTransaction {
extend(dst, b"\r\n");
body
}
fn should_error_on_parse_eof() -> bool {
false
}
}
impl ServerTransaction {
@@ -281,6 +285,10 @@ impl Http1Transaction for ClientTransaction {
body
}
fn should_error_on_parse_eof() -> bool {
true
}
}
impl ClientTransaction {