mirror of
https://github.com/actix/actix-extras.git
synced 2025-06-27 02:37:42 +02:00
use released versions of actix-net
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "actix-http"
|
||||
version = "0.3.0-alpha.1"
|
||||
version = "0.3.0-alpha.2"
|
||||
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
||||
description = "Actix http primitives"
|
||||
readme = "README.md"
|
||||
@ -47,15 +47,15 @@ fail = ["failure"]
|
||||
secure-cookies = ["ring"]
|
||||
|
||||
[dependencies]
|
||||
actix-service = "1.0.0-alpha.1"
|
||||
actix-codec = "0.2.0-alpha.1"
|
||||
actix-connect = "1.0.0-alpha.1"
|
||||
actix-utils = "0.5.0-alpha.1"
|
||||
actix-rt = "1.0.0-alpha.1"
|
||||
actix-threadpool = "0.2.0-alpha.1"
|
||||
actix-tls = { git = "https://github.com/actix/actix-net.git", optional = true }
|
||||
actix-service = "1.0.0-alpha.2"
|
||||
actix-codec = "0.2.0-alpha.2"
|
||||
actix-connect = "1.0.0-alpha.2"
|
||||
actix-utils = "1.0.0-alpha.2"
|
||||
actix-rt = "1.0.0-alpha.2"
|
||||
actix-threadpool = "0.3.0"
|
||||
actix-tls = { version = "1.0.0-alpha.1", optional = true }
|
||||
|
||||
base64 = "0.10"
|
||||
base64 = "0.11"
|
||||
bitflags = "1.0"
|
||||
bytes = "0.4"
|
||||
copyless = "0.1.4"
|
||||
@ -74,7 +74,7 @@ language-tags = "0.2"
|
||||
log = "0.4"
|
||||
mime = "0.3"
|
||||
percent-encoding = "2.1"
|
||||
pin-project = "0.4.5"
|
||||
pin-project = "0.4.6"
|
||||
rand = "0.7"
|
||||
regex = "1.0"
|
||||
serde = "1.0"
|
||||
@ -83,8 +83,6 @@ sha1 = "0.6"
|
||||
slab = "0.4"
|
||||
serde_urlencoded = "0.6.1"
|
||||
time = "0.1.42"
|
||||
|
||||
tokio-net = "=0.2.0-alpha.6"
|
||||
trust-dns-resolver = { version="0.18.0-alpha.1", default-features = false }
|
||||
|
||||
# for secure cookie
|
||||
@ -103,11 +101,10 @@ tokio-openssl = { version = "0.4.0-alpha.6", optional = true }
|
||||
# webpki-roots = { version = "0.18", optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
actix-server = { version = "0.8.0-alpha.1" }
|
||||
actix-connect = { version = "1.0.0-alpha.1", features=["openssl"] }
|
||||
actix-http-test = { version = "0.3.0-alpha.1", features=["openssl"] }
|
||||
#actix-tls = { version = "0.1.0-alpha.1", features=["openssl"] }
|
||||
actix-tls = { git = "https://github.com/actix/actix-net.git", features=["openssl"] }
|
||||
actix-server = { version = "1.0.0-alpha.2" }
|
||||
actix-connect = { version = "1.0.0-alpha.2", features=["openssl"] }
|
||||
actix-http-test = { version = "0.3.0-alpha.2", features=["openssl"] }
|
||||
actix-tls = { version = "1.0.0-alpha.1", features=["openssl"] }
|
||||
env_logger = "0.6"
|
||||
serde_derive = "1.0"
|
||||
open-ssl = { version="0.10", package="openssl" }
|
||||
|
@ -6,10 +6,10 @@ use actix_codec::{AsyncRead, AsyncWrite};
|
||||
use actix_connect::{
|
||||
default_connector, Connect as TcpConnect, Connection as TcpConnection,
|
||||
};
|
||||
use actix_rt::net::TcpStream;
|
||||
use actix_service::{apply_fn, Service};
|
||||
use actix_utils::timeout::{TimeoutError, TimeoutService};
|
||||
use http::Uri;
|
||||
use tokio_net::tcp::TcpStream;
|
||||
|
||||
use super::connection::Connection;
|
||||
use super::error::ConnectError;
|
||||
|
@ -21,7 +21,7 @@ pub struct Decoder<S> {
|
||||
decoder: Option<ContentDecoder>,
|
||||
stream: S,
|
||||
eof: bool,
|
||||
fut: Option<CpuFuture<Result<(Option<Bytes>, ContentDecoder), io::Error>>>,
|
||||
fut: Option<CpuFuture<(Option<Bytes>, ContentDecoder), io::Error>>,
|
||||
}
|
||||
|
||||
impl<S> Decoder<S>
|
||||
@ -85,8 +85,7 @@ where
|
||||
loop {
|
||||
if let Some(ref mut fut) = self.fut {
|
||||
let (chunk, decoder) = match ready!(Pin::new(fut).poll(cx)) {
|
||||
Ok(Ok(item)) => item,
|
||||
Ok(Err(e)) => return Poll::Ready(Some(Err(e.into()))),
|
||||
Ok(item) => item,
|
||||
Err(e) => return Poll::Ready(Some(Err(e.into()))),
|
||||
};
|
||||
self.decoder = Some(decoder);
|
||||
|
@ -24,7 +24,7 @@ pub struct Encoder<B> {
|
||||
eof: bool,
|
||||
body: EncoderBody<B>,
|
||||
encoder: Option<ContentEncoder>,
|
||||
fut: Option<CpuFuture<Result<ContentEncoder, io::Error>>>,
|
||||
fut: Option<CpuFuture<ContentEncoder, io::Error>>,
|
||||
}
|
||||
|
||||
impl<B: MessageBody> Encoder<B> {
|
||||
@ -104,8 +104,7 @@ impl<B: MessageBody> MessageBody for Encoder<B> {
|
||||
|
||||
if let Some(ref mut fut) = self.fut {
|
||||
let mut encoder = match futures::ready!(Pin::new(fut).poll(cx)) {
|
||||
Ok(Ok(item)) => item,
|
||||
Ok(Err(e)) => return Poll::Ready(Some(Err(e.into()))),
|
||||
Ok(item) => item,
|
||||
Err(e) => return Poll::Ready(Some(Err(e.into()))),
|
||||
};
|
||||
let chunk = encoder.take();
|
||||
|
@ -6,6 +6,7 @@ use std::str::Utf8Error;
|
||||
use std::string::FromUtf8Error;
|
||||
use std::{fmt, io, result};
|
||||
|
||||
pub use actix_threadpool::BlockingError;
|
||||
use actix_utils::timeout::TimeoutError;
|
||||
use bytes::BytesMut;
|
||||
use derive_more::{Display, From};
|
||||
@ -197,6 +198,9 @@ impl ResponseError for DeError {
|
||||
/// `InternalServerError` for `Canceled`
|
||||
impl ResponseError for Canceled {}
|
||||
|
||||
/// `InternalServerError` for `BlockingError`
|
||||
impl<E: fmt::Debug> ResponseError for BlockingError<E> {}
|
||||
|
||||
/// Return `BAD_REQUEST` for `Utf8Error`
|
||||
impl ResponseError for Utf8Error {
|
||||
fn status_code(&self) -> StatusCode {
|
||||
@ -359,12 +363,15 @@ impl From<io::Error> for PayloadError {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Canceled> for PayloadError {
|
||||
fn from(_: Canceled) -> Self {
|
||||
PayloadError::Io(io::Error::new(
|
||||
io::ErrorKind::Other,
|
||||
"Operation is canceled",
|
||||
))
|
||||
impl From<BlockingError<io::Error>> for PayloadError {
|
||||
fn from(err: BlockingError<io::Error>) -> Self {
|
||||
match err {
|
||||
BlockingError::Error(e) => PayloadError::Io(e),
|
||||
BlockingError::Canceled => PayloadError::Io(io::Error::new(
|
||||
io::ErrorKind::Other,
|
||||
"Operation is canceled",
|
||||
)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user