From df7801d623d22fbb7612ee58e80ac9e4a3de3dfd Mon Sep 17 00:00:00 2001 From: Henry de Valence Date: Thu, 19 Sep 2019 17:48:59 -0700 Subject: [PATCH] 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). --- zebrad/Cargo.toml | 4 +++- zebrad/src/components/tracing.rs | 10 ++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/zebrad/Cargo.toml b/zebrad/Cargo.toml index 85875077d..b204b20a0 100644 --- a/zebrad/Cargo.toml +++ b/zebrad/Cargo.toml @@ -15,7 +15,9 @@ tokio = "=0.2.0-alpha.4" tracing = "0.1" tracing-subscriber = "0.1" 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-util-preview = { version = "=0.3.0-alpha.18" } diff --git a/zebrad/src/components/tracing.rs b/zebrad/src/components/tracing.rs index e6bf823b2..c5f15fe02 100644 --- a/zebrad/src/components/tracing.rs +++ b/zebrad/src/components/tracing.rs @@ -106,7 +106,8 @@ async fn filter_handler( handle: Handle, req: Request, ) -> Result, hyper::Error> { - use futures_util::TryStreamExt; + // XXX see below + //use futures_util::TryStreamExt; use hyper::{Method, StatusCode}; // 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") => { // 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) { Err(e) => Response::builder() .status(StatusCode::BAD_REQUEST)