feat(http1): Add higher-level HTTP upgrade support to Client and Server (#1563)
- Adds `Body::on_upgrade()` that returns an `OnUpgrade` future.
- Adds `hyper::upgrade` module containing types for dealing with
  upgrades.
- Adds `server::conn::Connection::with_upgrades()` method to enable
  these upgrades when using lower-level API (because of a missing
  `Send` bound on the transport generic).
- Client connections are automatically enabled.
- Optimizes request parsing, to make up for extra work to look for
  upgrade requests.
  - Returns a smaller `DecodedLength` type instead of the fatter
    `Decoder`, which should also allow a couple fewer branches.
  - Removes the `Decode::Ignore` wrapper enum, and instead ignoring
    1xx responses is handled directly in the response parsing code.
Ref #1563 
Closes #1395
			
			
This commit is contained in:
		| @@ -29,7 +29,7 @@ iovec = "0.1" | ||||
| log = "0.4" | ||||
| net2 = { version = "0.2.32", optional = true } | ||||
| time = "0.1" | ||||
| tokio = { version = "0.1.5", optional = true } | ||||
| tokio = { version = "0.1.7", optional = true } | ||||
| tokio-executor = { version = "0.1.0", optional = true } | ||||
| tokio-io = "0.1" | ||||
| tokio-reactor = { version = "0.1", optional = true } | ||||
| @@ -101,6 +101,12 @@ name = "send_file" | ||||
| path = "examples/send_file.rs" | ||||
| required-features = ["runtime"] | ||||
|  | ||||
| [[example]] | ||||
| name = "upgrades" | ||||
| path = "examples/upgrades.rs" | ||||
| required-features = ["runtime"] | ||||
|  | ||||
|  | ||||
| [[example]] | ||||
| name = "web_api" | ||||
| path = "examples/web_api.rs" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user