Temporarily change hyper to git version.
This avoids some crate selection conflicts, but makes some futures extension traits fall out of order? This seems to be an issue with `pin-project` resolved in the git branch of `hyper` (but not yet released).
This commit is contained in:
parent
976a81e7b9
commit
df7801d623
|
@ -15,7 +15,9 @@ tokio = "=0.2.0-alpha.4"
|
||||||
tracing = "0.1"
|
tracing = "0.1"
|
||||||
tracing-subscriber = "0.1"
|
tracing-subscriber = "0.1"
|
||||||
tracing-log = "=0.0.1-alpha.2"
|
tracing-log = "=0.0.1-alpha.2"
|
||||||
hyper = "=0.13.0-alpha.1"
|
# Can't use published alpha because of conflicts tracking pin-project alphas
|
||||||
|
#hyper = "=0.13.0-alpha.1"
|
||||||
|
hyper = { git = "https://github.com/hyperium/hyper" }
|
||||||
futures-core-preview = { version = "=0.3.0-alpha.18" }
|
futures-core-preview = { version = "=0.3.0-alpha.18" }
|
||||||
futures-util-preview = { version = "=0.3.0-alpha.18" }
|
futures-util-preview = { version = "=0.3.0-alpha.18" }
|
||||||
|
|
||||||
|
|
|
@ -106,7 +106,8 @@ async fn filter_handler<S: Subscriber>(
|
||||||
handle: Handle<EnvFilter, S>,
|
handle: Handle<EnvFilter, S>,
|
||||||
req: Request<Body>,
|
req: Request<Body>,
|
||||||
) -> Result<Response<Body>, hyper::Error> {
|
) -> Result<Response<Body>, hyper::Error> {
|
||||||
use futures_util::TryStreamExt;
|
// XXX see below
|
||||||
|
//use futures_util::TryStreamExt;
|
||||||
use hyper::{Method, StatusCode};
|
use hyper::{Method, StatusCode};
|
||||||
|
|
||||||
// We can't use #[instrument] because Handle<_,_> is not Debug,
|
// We can't use #[instrument] because Handle<_,_> is not Debug,
|
||||||
|
@ -126,7 +127,12 @@ curl -X POST localhost:3000/filter -d "zebrad=trace"
|
||||||
)),
|
)),
|
||||||
(&Method::POST, "/filter") => {
|
(&Method::POST, "/filter") => {
|
||||||
// Combine all HTTP request chunks into one
|
// Combine all HTTP request chunks into one
|
||||||
let whole_chunk = req.into_body().try_concat().await?;
|
//let whole_chunk = req.into_body().try_concat().await?;
|
||||||
|
// XXX try_concat extension trait is not applying for some reason,
|
||||||
|
// just pull one chunk
|
||||||
|
let mut body = req.into_body();
|
||||||
|
let maybe_chunk = body.next().await;
|
||||||
|
let whole_chunk = maybe_chunk.unwrap()?;
|
||||||
match reload_filter_from_chunk(handle, whole_chunk) {
|
match reload_filter_from_chunk(handle, whole_chunk) {
|
||||||
Err(e) => Response::builder()
|
Err(e) => Response::builder()
|
||||||
.status(StatusCode::BAD_REQUEST)
|
.status(StatusCode::BAD_REQUEST)
|
||||||
|
|
Loading…
Reference in New Issue