1
0
mirror of https://github.com/actix/actix-extras.git synced 2024-12-01 02:44:37 +01:00

update h2 lib

This commit is contained in:
Nikolay Kim 2018-01-02 19:37:33 -08:00
parent 3768a2885d
commit 3a59344ffb
4 changed files with 11 additions and 8 deletions

View File

@ -115,3 +115,6 @@ members = [
"examples/websocket", "examples/websocket",
"examples/websocket-chat", "examples/websocket-chat",
] ]
[patch.crates-io]
ring = { git = "https://github.com/SergioBenitez/ring", branch = "v0.12" }

View File

@ -84,7 +84,7 @@ fn main() {
} }
})) }))
// static files // static files
.handler("/static/", fs::StaticFiles::new("tail", "../static/", true)) .handler("/static/", fs::StaticFiles::new("../static/", true))
// redirect // redirect
.resource("/", |r| r.method(Method::GET).f(|req| { .resource("/", |r| r.method(Method::GET).f(|req| {
println!("{:?}", req); println!("{:?}", req);

View File

@ -8,7 +8,7 @@ use std::collections::VecDeque;
use actix::Arbiter; use actix::Arbiter;
use http::request::Parts; use http::request::Parts;
use http2::{Reason, RecvStream}; use http2::{Reason, RecvStream};
use http2::server::{Server, Handshake, Respond}; use http2::server::{self, Connection, Handshake, SendResponse};
use bytes::{Buf, Bytes}; use bytes::{Buf, Bytes};
use futures::{Async, Poll, Future, Stream}; use futures::{Async, Poll, Future, Stream};
use tokio_io::{AsyncRead, AsyncWrite}; use tokio_io::{AsyncRead, AsyncWrite};
@ -44,7 +44,7 @@ pub(crate) struct Http2<T, H>
enum State<T: AsyncRead + AsyncWrite> { enum State<T: AsyncRead + AsyncWrite> {
Handshake(Handshake<T, Bytes>), Handshake(Handshake<T, Bytes>),
Server(Server<T, Bytes>), Server(Connection<T, Bytes>),
Empty, Empty,
} }
@ -59,7 +59,7 @@ impl<T, H> Http2<T, H>
addr: addr, addr: addr,
tasks: VecDeque::new(), tasks: VecDeque::new(),
state: State::Handshake( state: State::Handshake(
Server::handshake(IoWrapper{unread: Some(buf), inner: io})), server::handshake(IoWrapper{unread: Some(buf), inner: io})),
keepalive_timer: None, keepalive_timer: None,
} }
} }
@ -242,7 +242,7 @@ struct Entry {
impl Entry { impl Entry {
fn new<H>(parts: Parts, fn new<H>(parts: Parts,
recv: RecvStream, recv: RecvStream,
resp: Respond<Bytes>, resp: SendResponse<Bytes>,
addr: Option<SocketAddr>, addr: Option<SocketAddr>,
settings: &Rc<WorkerSettings<H>>) -> Entry settings: &Rc<WorkerSettings<H>>) -> Entry
where H: HttpHandler + 'static where H: HttpHandler + 'static

View File

@ -2,7 +2,7 @@ use std::{io, cmp};
use bytes::{Bytes, BytesMut}; use bytes::{Bytes, BytesMut};
use futures::{Async, Poll}; use futures::{Async, Poll};
use http2::{Reason, SendStream}; use http2::{Reason, SendStream};
use http2::server::Respond; use http2::server::SendResponse;
use http::{Version, HttpTryFrom, Response}; use http::{Version, HttpTryFrom, Response};
use http::header::{HeaderValue, CONNECTION, TRANSFER_ENCODING, DATE, CONTENT_LENGTH}; use http::header::{HeaderValue, CONNECTION, TRANSFER_ENCODING, DATE, CONTENT_LENGTH};
@ -26,7 +26,7 @@ bitflags! {
} }
pub(crate) struct H2Writer { pub(crate) struct H2Writer {
respond: Respond<Bytes>, respond: SendResponse<Bytes>,
stream: Option<SendStream<Bytes>>, stream: Option<SendStream<Bytes>>,
encoder: PayloadEncoder, encoder: PayloadEncoder,
flags: Flags, flags: Flags,
@ -36,7 +36,7 @@ pub(crate) struct H2Writer {
impl H2Writer { impl H2Writer {
pub fn new(respond: Respond<Bytes>, buf: SharedBytes) -> H2Writer { pub fn new(respond: SendResponse<Bytes>, buf: SharedBytes) -> H2Writer {
H2Writer { H2Writer {
respond: respond, respond: respond,
stream: None, stream: None,