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:
Henry de Valence 2019-09-19 17:48:59 -07:00 committed by Deirdre Connolly
parent 976a81e7b9
commit df7801d623
2 changed files with 11 additions and 3 deletions

View File

@ -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" }

View File

@ -106,7 +106,8 @@ async fn filter_handler<S: Subscriber>(
handle: Handle<EnvFilter, S>,
req: Request<Body>,
) -> Result<Response<Body>, 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)