From f23974cfb56b96f6d55ceae70271f74ba447ade2 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Sat, 4 Nov 2017 13:49:05 -0700 Subject: [PATCH] update readme --- README.md | 13 ++++++++----- src/channel.rs | 2 +- src/h1.rs | 4 ++-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index efbb72e6..e87b0dc3 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Actix web is licensed under the [Apache-2.0 license](http://opensource.org/licen ## Features - * HTTP/1 and HTTP/2 + * Supported HTTP/1 and HTTP/2 protocols * Streaming and pipelining * Keep-alive and slow requests handling * [WebSockets](https://actix.github.io/actix-web/actix_web/ws/index.html) @@ -32,21 +32,24 @@ actix-web = { git = "https://github.com/actix/actix-web" } ## HTTP/2 -### Usage - Actix web automatically upgrades connection to `http/2` if possible. ### Negotiation -To use http/2 protocol over tls without prior knowlage requires +To use `http/2` protocol over tls without prior knowlage requires [tls alpn](https://tools.ietf.org/html/rfc7301). At the moment only -rust-openssl supports alpn. +`rust-openssl` supports alpn. ```toml [dependencies] actix-web = { git = "https://github.com/actix/actix-web", features=["alpn"] } ``` +Upgrade to `http/2` schema described in +[rfc section3.2](https://http2.github.io/http2-spec/#rfc.section.3.2) is not supported. +Starting `http/2` with prior knowledge is supported for both clear text connection +and tls connection. [rfc link](https://http2.github.io/http2-spec/#rfc.section.3.4) + ## Example * [Basic](https://github.com/actix/actix-web/tree/master/examples/basic.rs) diff --git a/src/channel.rs b/src/channel.rs index 3c265c02..3f5ece3d 100644 --- a/src/channel.rs +++ b/src/channel.rs @@ -72,7 +72,7 @@ impl Future for HttpChannel match h1.poll() { Ok(Async::Ready(h1::Http1Result::Done)) => return Ok(Async::Ready(())), - Ok(Async::Ready(h1::Http1Result::Upgrade)) => (), + Ok(Async::Ready(h1::Http1Result::Switch)) => (), Ok(Async::NotReady) => return Ok(Async::NotReady), Err(_) => diff --git a/src/h1.rs b/src/h1.rs index cb2a156d..f2189e00 100644 --- a/src/h1.rs +++ b/src/h1.rs @@ -31,7 +31,7 @@ const HTTP2_PREFACE: [u8; 14] = *b"PRI * HTTP/2.0"; pub(crate) enum Http1Result { Done, - Upgrade, + Switch, } pub(crate) struct Http1 { @@ -157,7 +157,7 @@ impl Http1 // no keep-alive if !self.keepalive && self.tasks.is_empty() { if self.h2 { - return Ok(Async::Ready(Http1Result::Upgrade)) + return Ok(Async::Ready(Http1Result::Switch)) } else { return Ok(Async::Ready(Http1Result::Done)) }