From 3a59344ffbbf7ad6231edc0927b72c8ed1d590f6 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Tue, 2 Jan 2018 19:37:33 -0800 Subject: [PATCH] update h2 lib --- Cargo.toml | 3 +++ examples/basics/src/main.rs | 2 +- src/h2.rs | 8 ++++---- src/h2writer.rs | 6 +++--- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 7a106be6e..5ba819c4f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -115,3 +115,6 @@ members = [ "examples/websocket", "examples/websocket-chat", ] + +[patch.crates-io] +ring = { git = "https://github.com/SergioBenitez/ring", branch = "v0.12" } diff --git a/examples/basics/src/main.rs b/examples/basics/src/main.rs index 9855fe777..82d0639a6 100644 --- a/examples/basics/src/main.rs +++ b/examples/basics/src/main.rs @@ -84,7 +84,7 @@ fn main() { } })) // static files - .handler("/static/", fs::StaticFiles::new("tail", "../static/", true)) + .handler("/static/", fs::StaticFiles::new("../static/", true)) // redirect .resource("/", |r| r.method(Method::GET).f(|req| { println!("{:?}", req); diff --git a/src/h2.rs b/src/h2.rs index be8898038..89998afc9 100644 --- a/src/h2.rs +++ b/src/h2.rs @@ -8,7 +8,7 @@ use std::collections::VecDeque; use actix::Arbiter; use http::request::Parts; use http2::{Reason, RecvStream}; -use http2::server::{Server, Handshake, Respond}; +use http2::server::{self, Connection, Handshake, SendResponse}; use bytes::{Buf, Bytes}; use futures::{Async, Poll, Future, Stream}; use tokio_io::{AsyncRead, AsyncWrite}; @@ -44,7 +44,7 @@ pub(crate) struct Http2 enum State { Handshake(Handshake), - Server(Server), + Server(Connection), Empty, } @@ -59,7 +59,7 @@ impl Http2 addr: addr, tasks: VecDeque::new(), state: State::Handshake( - Server::handshake(IoWrapper{unread: Some(buf), inner: io})), + server::handshake(IoWrapper{unread: Some(buf), inner: io})), keepalive_timer: None, } } @@ -242,7 +242,7 @@ struct Entry { impl Entry { fn new(parts: Parts, recv: RecvStream, - resp: Respond, + resp: SendResponse, addr: Option, settings: &Rc>) -> Entry where H: HttpHandler + 'static diff --git a/src/h2writer.rs b/src/h2writer.rs index 0b21421f5..9af11010f 100644 --- a/src/h2writer.rs +++ b/src/h2writer.rs @@ -2,7 +2,7 @@ use std::{io, cmp}; use bytes::{Bytes, BytesMut}; use futures::{Async, Poll}; use http2::{Reason, SendStream}; -use http2::server::Respond; +use http2::server::SendResponse; use http::{Version, HttpTryFrom, Response}; use http::header::{HeaderValue, CONNECTION, TRANSFER_ENCODING, DATE, CONTENT_LENGTH}; @@ -26,7 +26,7 @@ bitflags! { } pub(crate) struct H2Writer { - respond: Respond, + respond: SendResponse, stream: Option>, encoder: PayloadEncoder, flags: Flags, @@ -36,7 +36,7 @@ pub(crate) struct H2Writer { impl H2Writer { - pub fn new(respond: Respond, buf: SharedBytes) -> H2Writer { + pub fn new(respond: SendResponse, buf: SharedBytes) -> H2Writer { H2Writer { respond: respond, stream: None,