Skip to content

Commit

Permalink
upgrade to tokio 0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
fafhrd91 committed Dec 5, 2019
1 parent b45c6cd commit 205a964
Show file tree
Hide file tree
Showing 72 changed files with 763 additions and 554 deletions.
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changes

## [2.0.0-alpha.3] - 2019-12-xx

### Changed

* Migrate to tokio 0.2


## [2.0.0-alpha.1] - 2019-11-22

### Changed
Expand Down
34 changes: 22 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "actix-web"
version = "2.0.0-alpha.2"
version = "2.0.0-alpha.3"
authors = ["Nikolay Kim <[email protected]>"]
description = "Actix web is a simple, pragmatic and extremely fast web framework for Rust."
readme = "README.md"
Expand Down Expand Up @@ -66,24 +66,24 @@ fail = ["actix-http/fail"]
openssl = ["open-ssl", "actix-tls/openssl", "awc/openssl"]

# rustls
# rustls = ["rust-tls", "actix-server/rustls", "awc/rustls"]
rustls = ["rust-tls", "actix-tls/rustls", "awc/rustls"]

[dependencies]
actix-codec = "0.2.0-alpha.2"
actix-service = "1.0.0-alpha.2"
actix-utils = "1.0.0-alpha.2"
actix-router = "0.1.5"
actix-rt = "1.0.0-alpha.2"
actix-server = "1.0.0-alpha.2"
actix-testing = "1.0.0-alpha.2"
actix-codec = "0.2.0-alpha.3"
actix-service = "1.0.0-alpha.3"
actix-utils = "1.0.0-alpha.3"
actix-router = "0.2.0"
actix-rt = "1.0.0-alpha.3"
actix-server = "1.0.0-alpha.3"
actix-testing = "1.0.0-alpha.3"
actix-threadpool = "0.3.0"
actix-tls = { version = "1.0.0-alpha.1" }
actix-tls = { version = "1.0.0-alpha.3" }

actix-web-codegen = "0.2.0-alpha.2"
actix-http = "0.3.0-alpha.2"
awc = { version = "0.3.0-alpha.2", optional = true }

bytes = "0.4"
bytes = "0.5.2"
derive_more = "0.99.2"
encoding_rs = "0.8"
futures = "0.3.1"
Expand All @@ -102,7 +102,7 @@ url = "2.1"

# ssl support
open-ssl = { version="0.10", package="openssl", optional = true }
# rust-tls = { version = "0.16", package="rustls", optional = true }
rust-tls = { version = "0.16", package="rustls", optional = true }

[dev-dependencies]
# actix = "0.8.3"
Expand Down Expand Up @@ -130,3 +130,13 @@ actix-session = { path = "actix-session" }
actix-files = { path = "actix-files" }
actix-multipart = { path = "actix-multipart" }
awc = { path = "awc" }

actix-codec = { git = "https://github.com/actix/actix-net.git" }
actix-connect = { git = "https://github.com/actix/actix-net.git" }
actix-rt = { git = "https://github.com/actix/actix-net.git" }
actix-server = { git = "https://github.com/actix/actix-net.git" }
actix-service = { git = "https://github.com/actix/actix-net.git" }
actix-testing = { git = "https://github.com/actix/actix-net.git" }
actix-tls = { git = "https://github.com/actix/actix-net.git" }
actix-utils = { git = "https://github.com/actix/actix-net.git" }
actix-router = { git = "https://github.com/actix/actix-net.git" }
6 changes: 4 additions & 2 deletions actix-cors/CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Changes

## [0.1.1] - unreleased
## [0.2.0-alpha.3] - unreleased

* Bump `derive_more` crate version to 0.15.0
* Migrate to actix-web 2.0.0

* Bump `derive_more` crate version to 0.99.0

## [0.1.0] - 2019-06-15

Expand Down
2 changes: 1 addition & 1 deletion actix-cors/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "actix-cors"
version = "0.2.0-alpha.1"
version = "0.2.0-alpha.3"
authors = ["Nikolay Kim <[email protected]>"]
description = "Cross-origin resource sharing (CORS) for Actix applications."
readme = "README.md"
Expand Down
15 changes: 10 additions & 5 deletions actix-cors/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
//!
//! Cors middleware automatically handle *OPTIONS* preflight request.
use std::collections::HashSet;
use std::convert::TryFrom;
use std::iter::FromIterator;
use std::rc::Rc;
use std::task::{Context, Poll};
Expand All @@ -48,7 +49,7 @@ use actix_service::{Service, Transform};
use actix_web::dev::{RequestHead, ServiceRequest, ServiceResponse};
use actix_web::error::{Error, ResponseError, Result};
use actix_web::http::header::{self, HeaderName, HeaderValue};
use actix_web::http::{self, HttpTryFrom, Method, StatusCode, Uri};
use actix_web::http::{self, Error as HttpError, Method, StatusCode, Uri};
use actix_web::HttpResponse;
use derive_more::Display;
use futures::future::{ok, Either, FutureExt, LocalBoxFuture, Ready};
Expand Down Expand Up @@ -274,7 +275,8 @@ impl Cors {
pub fn allowed_methods<U, M>(mut self, methods: U) -> Cors
where
U: IntoIterator<Item = M>,
Method: HttpTryFrom<M>,
Method: TryFrom<M>,
<Method as TryFrom<M>>::Error: Into<HttpError>,
{
self.methods = true;
if let Some(cors) = cors(&mut self.cors, &self.error) {
Expand All @@ -296,7 +298,8 @@ impl Cors {
/// Set an allowed header
pub fn allowed_header<H>(mut self, header: H) -> Cors
where
HeaderName: HttpTryFrom<H>,
HeaderName: TryFrom<H>,
<HeaderName as TryFrom<H>>::Error: Into<HttpError>,
{
if let Some(cors) = cors(&mut self.cors, &self.error) {
match HeaderName::try_from(header) {
Expand Down Expand Up @@ -328,7 +331,8 @@ impl Cors {
pub fn allowed_headers<U, H>(mut self, headers: U) -> Cors
where
U: IntoIterator<Item = H>,
HeaderName: HttpTryFrom<H>,
HeaderName: TryFrom<H>,
<HeaderName as TryFrom<H>>::Error: Into<HttpError>,
{
if let Some(cors) = cors(&mut self.cors, &self.error) {
for h in headers {
Expand Down Expand Up @@ -362,7 +366,8 @@ impl Cors {
pub fn expose_headers<U, H>(mut self, headers: U) -> Cors
where
U: IntoIterator<Item = H>,
HeaderName: HttpTryFrom<H>,
HeaderName: TryFrom<H>,
<HeaderName as TryFrom<H>>::Error: Into<HttpError>,
{
for h in headers {
match HeaderName::try_from(h) {
Expand Down
6 changes: 3 additions & 3 deletions actix-files/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "actix-files"
version = "0.2.0-alpha.2"
version = "0.2.0-alpha.3"
authors = ["Nikolay Kim <[email protected]>"]
description = "Static files support for actix web."
readme = "README.md"
Expand All @@ -20,9 +20,9 @@ path = "src/lib.rs"
[dependencies]
actix-web = { version = "2.0.0-alpha.2", default-features = false }
actix-http = "0.3.0-alpha.2"
actix-service = "1.0.0-alpha.2"
actix-service = "1.0.0-alpha.3"
bitflags = "1"
bytes = "0.4"
bytes = "0.5.2"
futures = "0.3.1"
derive_more = "0.99.2"
log = "0.4"
Expand Down
20 changes: 10 additions & 10 deletions actix-framed/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ name = "actix_framed"
path = "src/lib.rs"

[dependencies]
actix-codec = "0.2.0-alpha.2"
actix-service = "1.0.0-alpha.2"
actix-router = "0.1.2"
actix-rt = "1.0.0-alpha.2"
actix-http = "0.3.0-alpha.2"
actix-codec = "0.2.0-alpha.3"
actix-service = "1.0.0-alpha.3"
actix-router = "0.2.0"
actix-rt = "1.0.0-alpha.3"
actix-http = "0.3.0-alpha.3"

bytes = "0.4"
bytes = "0.5.2"
futures = "0.3.1"
pin-project = "0.4.6"
log = "0.4"

[dev-dependencies]
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-utils = "1.0.0-alpha.2"
actix-server = { version = "1.0.0-alpha.3" }
actix-connect = { version = "1.0.0-alpha.3", features=["openssl"] }
actix-http-test = { version = "0.3.0-alpha.3", features=["openssl"] }
actix-utils = "1.0.0-alpha.3"
4 changes: 3 additions & 1 deletion actix-framed/src/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ impl<Io, S> FramedRequest<Io, S> {

#[cfg(test)]
mod tests {
use actix_http::http::{HeaderName, HeaderValue, HttpTryFrom};
use std::convert::TryFrom;

use actix_http::http::{HeaderName, HeaderValue};
use actix_http::test::{TestBuffer, TestRequest};

use super::*;
Expand Down
9 changes: 6 additions & 3 deletions actix-framed/src/test.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
//! Various helpers for Actix applications to use during testing.
use std::convert::TryFrom;
use std::future::Future;

use actix_codec::Framed;
use actix_http::h1::Codec;
use actix_http::http::header::{Header, HeaderName, IntoHeaderValue};
use actix_http::http::{HttpTryFrom, Method, Uri, Version};
use actix_http::http::{Error as HttpError, Method, Uri, Version};
use actix_http::test::{TestBuffer, TestRequest as HttpTestRequest};
use actix_router::{Path, Url};

Expand Down Expand Up @@ -41,7 +42,8 @@ impl TestRequest<()> {
/// Create TestRequest and set header
pub fn with_header<K, V>(key: K, value: V) -> Self
where
HeaderName: HttpTryFrom<K>,
HeaderName: TryFrom<K>,
<HeaderName as TryFrom<K>>::Error: Into<HttpError>,
V: IntoHeaderValue,
{
Self::default().header(key, value)
Expand Down Expand Up @@ -96,7 +98,8 @@ impl<S> TestRequest<S> {
/// Set a header
pub fn header<K, V>(mut self, key: K, value: V) -> Self
where
HeaderName: HttpTryFrom<K>,
HeaderName: TryFrom<K>,
<HeaderName as TryFrom<K>>::Error: Into<HttpError>,
V: IntoHeaderValue,
{
self.req.header(key, value);
Expand Down
6 changes: 3 additions & 3 deletions actix-framed/tests/test_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use actix_http::{body, http::StatusCode, ws, Error, HttpService, Response};
use actix_http_test::TestServer;
use actix_service::{pipeline_factory, IntoServiceFactory, ServiceFactory};
use actix_utils::framed::FramedTransport;
use bytes::{Bytes, BytesMut};
use bytes::BytesMut;
use futures::{future, SinkExt, StreamExt};

use actix_framed::{FramedApp, FramedRequest, FramedRoute, SendError, VerifyWebSockets};
Expand Down Expand Up @@ -70,7 +70,7 @@ async fn test_simple() {
let (item, mut framed) = framed.into_future().await;
assert_eq!(
item.unwrap().unwrap(),
ws::Frame::Binary(Some(Bytes::from_static(b"text").into()))
ws::Frame::Binary(Some(BytesMut::from(&b"text"[..])))
);

framed.send(ws::Message::Ping("text".into())).await.unwrap();
Expand Down Expand Up @@ -136,7 +136,7 @@ async fn test_service() {
let (item, mut framed) = framed.into_future().await;
assert_eq!(
item.unwrap().unwrap(),
ws::Frame::Binary(Some(Bytes::from_static(b"text").into()))
ws::Frame::Binary(Some(BytesMut::from(&b"text"[..])))
);

framed.send(ws::Message::Ping("text".into())).await.unwrap();
Expand Down
45 changes: 20 additions & 25 deletions actix-http/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "actix-http"
version = "0.3.0-alpha.2"
version = "0.3.0-alpha.3"
authors = ["Nikolay Kim <[email protected]>"]
description = "Actix http primitives"
readme = "README.md"
Expand All @@ -16,7 +16,7 @@ edition = "2018"
workspace = ".."

[package.metadata.docs.rs]
features = ["openssl", "fail", "brotli", "flate2-zlib", "secure-cookies"]
features = ["openssl", "rustls", "fail", "brotli", "flate2-zlib", "secure-cookies"]

[lib]
name = "actix_http"
Expand All @@ -26,10 +26,10 @@ path = "src/lib.rs"
default = []

# openssl
openssl = ["open-ssl", "actix-tls/openssl", "actix-connect/openssl", "tokio-openssl"]
openssl = ["actix-tls/openssl", "actix-connect/openssl"]

# rustls support
# rustls = ["rust-tls", "webpki-roots", "actix-connect/rustls"]
rustls = ["actix-tls/rustls", "actix-connect/rustls"]

# brotli encoding, requires c compiler
brotli = ["brotli2"]
Expand All @@ -47,26 +47,26 @@ fail = ["failure"]
secure-cookies = ["ring"]

[dependencies]
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-service = "1.0.0-alpha.3"
actix-codec = "0.2.0-alpha.3"
actix-connect = "1.0.0-alpha.3"
actix-utils = "1.0.0-alpha.3"
actix-rt = "1.0.0-alpha.3"
actix-threadpool = "0.3.0"
actix-tls = { version = "1.0.0-alpha.1", optional = true }
actix-tls = { version = "1.0.0-alpha.3", optional = true }

base64 = "0.11"
bitflags = "1.0"
bytes = "0.4"
bytes = "0.5.2"
copyless = "0.1.4"
chrono = "0.4.6"
derive_more = "0.99.2"
either = "1.5.2"
encoding_rs = "0.8"
futures = "0.3.1"
fxhash = "0.2.1"
h2 = "0.2.0-alpha.3"
http = "0.1.17"
h2 = "0.2.0"
http = "0.2.0"
httparse = "1.3"
indexmap = "1.2"
lazy_static = "1.0"
Expand All @@ -76,14 +76,13 @@ mime = "0.3"
percent-encoding = "2.1"
pin-project = "0.4.6"
rand = "0.7"
regex = "1.0"
regex = "1.3"
serde = "1.0"
serde_json = "1.0"
sha1 = "0.6"
slab = "0.4"
serde_urlencoded = "0.6.1"
time = "0.1.42"
trust-dns-resolver = { version="0.18.0-alpha.1", default-features = false }

# for secure cookie
ring = { version = "0.16.9", optional = true }
Expand All @@ -94,17 +93,13 @@ flate2 = { version="1.0.7", optional = true, default-features = false }

# optional deps
failure = { version = "0.1.5", optional = true }
open-ssl = { version="0.10", package="openssl", optional = true }
tokio-openssl = { version = "0.4.0-alpha.6", optional = true }

# rust-tls = { version = "0.16.0", package="rustls", optional = true }
# webpki-roots = { version = "0.18", optional = true }

[dev-dependencies]
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"] }
actix-server = { version = "1.0.0-alpha.3" }
actix-connect = { version = "1.0.0-alpha.3", features=["openssl"] }
actix-http-test = { version = "0.3.0-alpha.3", features=["openssl"] }
actix-tls = { version = "1.0.0-alpha.3", features=["openssl"] }
env_logger = "0.6"
serde_derive = "1.0"
open-ssl = { version="0.10", package="openssl" }
open-ssl = { version="0.10", package = "openssl" }
rust-tls = { version="0.16", package = "rustls" }
Loading

0 comments on commit 205a964

Please sign in to comment.