mirror of https://github.com/rwf2/Rocket.git
Update 'hyper', 'tokio', and 'tokio-rustls'.
* hyper -> 0.13.0-alpha.2 * tokio -> 0.2.0-alpha.5 * tokio-rustls -> 0.12.0-alpha.3
This commit is contained in:
parent
af36f299c6
commit
d1815e527f
|
@ -22,16 +22,17 @@ private-cookies = ["cookie/private", "cookie/key-expansion"]
|
||||||
[dependencies]
|
[dependencies]
|
||||||
smallvec = "1.0"
|
smallvec = "1.0"
|
||||||
percent-encoding = "1"
|
percent-encoding = "1"
|
||||||
hyper = { version = "=0.13.0-alpha.1", default-features = false }
|
# TODO.async: stop using stream-unstable
|
||||||
|
hyper = { version = "=0.13.0-alpha.2", default-features = false, features = ["unstable-stream"] }
|
||||||
http = "0.1.17"
|
http = "0.1.17"
|
||||||
mime = "0.3.13"
|
mime = "0.3.13"
|
||||||
time = "0.2.11"
|
time = "0.2.11"
|
||||||
indexmap = "1.0"
|
indexmap = "1.0"
|
||||||
state = "0.4"
|
state = "0.4"
|
||||||
tokio-rustls = { version = "0.12.0-alpha.2", optional = true }
|
tokio-rustls = { version = "0.12.0-alpha.3", optional = true }
|
||||||
tokio-io = "=0.2.0-alpha.4"
|
tokio-io = "=0.2.0-alpha.5"
|
||||||
tokio-net = "=0.2.0-alpha.4"
|
tokio-net = "=0.2.0-alpha.5"
|
||||||
tokio-timer = "=0.3.0-alpha.4"
|
tokio-timer = "=0.3.0-alpha.5"
|
||||||
cookie = { version = "0.14.0", features = ["percent-encode"] }
|
cookie = { version = "0.14.0", features = ["percent-encode"] }
|
||||||
pear = "0.1"
|
pear = "0.1"
|
||||||
unicode-xid = "0.2"
|
unicode-xid = "0.2"
|
||||||
|
|
|
@ -6,8 +6,7 @@ use std::pin::Pin;
|
||||||
use std::task::{Context, Poll};
|
use std::task::{Context, Poll};
|
||||||
use std::time::{Duration, Instant};
|
use std::time::{Duration, Instant};
|
||||||
|
|
||||||
use futures::ready;
|
use hyper::server::accept::Accept;
|
||||||
use futures::stream::Stream;
|
|
||||||
|
|
||||||
use log::{debug, error};
|
use log::{debug, error};
|
||||||
|
|
||||||
|
@ -35,8 +34,8 @@ pub trait Connection: AsyncRead + AsyncWrite {
|
||||||
|
|
||||||
/// This is a genericized version of hyper's AddrIncoming that is intended to be
|
/// This is a genericized version of hyper's AddrIncoming that is intended to be
|
||||||
/// usable with listeners other than a plain TCP stream, e.g. TLS and/or Unix
|
/// usable with listeners other than a plain TCP stream, e.g. TLS and/or Unix
|
||||||
/// sockets. It does this by briding the `Listener` trait to what hyper wants (a
|
/// sockets. It does this by bridging the `Listener` trait to what hyper wants
|
||||||
/// Stream of AsyncRead+AsyncWrite). This type is internal to Rocket.
|
/// (an Accept). This type is internal to Rocket.
|
||||||
#[must_use = "streams do nothing unless polled"]
|
#[must_use = "streams do nothing unless polled"]
|
||||||
pub struct Incoming<L> {
|
pub struct Incoming<L> {
|
||||||
listener: L,
|
listener: L,
|
||||||
|
@ -73,7 +72,7 @@ impl<L: Listener> Incoming<L> {
|
||||||
self.sleep_on_errors = val;
|
self.sleep_on_errors = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
fn poll_next_(&mut self, cx: &mut Context<'_>) -> Poll<io::Result<L::Connection>> {
|
fn poll_next(&mut self, cx: &mut Context<'_>) -> Poll<io::Result<L::Connection>> {
|
||||||
// Check if a previous delay is active that was set by IO errors.
|
// Check if a previous delay is active that was set by IO errors.
|
||||||
if let Some(ref mut delay) = self.pending_error_delay {
|
if let Some(ref mut delay) = self.pending_error_delay {
|
||||||
match Pin::new(delay).poll(cx) {
|
match Pin::new(delay).poll(cx) {
|
||||||
|
@ -124,11 +123,12 @@ impl<L: Listener> Incoming<L> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<L: Listener + Unpin> Stream for Incoming<L> {
|
impl<L: Listener + Unpin> Accept for Incoming<L> {
|
||||||
type Item = io::Result<L::Connection>;
|
type Conn = L::Connection;
|
||||||
|
type Error = io::Error;
|
||||||
|
|
||||||
fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
|
fn poll_accept(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Result<Self::Conn, Self::Error>>> {
|
||||||
let result = ready!(self.poll_next_(cx));
|
let result = futures::ready!(self.poll_next(cx));
|
||||||
Poll::Ready(Some(result))
|
Poll::Ready(Some(result))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@ rocket_codegen = { version = "0.5.0-dev", path = "../codegen" }
|
||||||
rocket_http = { version = "0.5.0-dev", path = "../http" }
|
rocket_http = { version = "0.5.0-dev", path = "../http" }
|
||||||
futures-preview = "0.3.0-alpha.18"
|
futures-preview = "0.3.0-alpha.18"
|
||||||
futures-tokio-compat = { git = "https://github.com/Nemo157/futures-tokio-compat", rev = "8a93702" }
|
futures-tokio-compat = { git = "https://github.com/Nemo157/futures-tokio-compat", rev = "8a93702" }
|
||||||
tokio = "=0.2.0-alpha.4"
|
tokio = "=0.2.0-alpha.5"
|
||||||
yansi = "0.5"
|
yansi = "0.5"
|
||||||
log = { version = "0.4", features = ["std"] }
|
log = { version = "0.4", features = ["std"] }
|
||||||
toml = "0.4.7"
|
toml = "0.4.7"
|
||||||
|
|
Loading…
Reference in New Issue