Skip to content

Commit

Permalink
update actix-service dep
Browse files Browse the repository at this point in the history
  • Loading branch information
fafhrd91 committed Dec 22, 2019
1 parent f45db1f commit c7f3915
Show file tree
Hide file tree
Showing 16 changed files with 76 additions and 101 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ rustls = ["actix-tls/rustls", "awc/rustls", "rust-tls"]

[dependencies]
actix-codec = "0.2.0"
actix-service = "1.0.0"
actix-utils = "1.0.3"
actix-service = "1.0.1"
actix-utils = "1.0.4"
actix-router = "0.2.0"
actix-rt = "1.0.0"
actix-server = "1.0.0"
Expand Down
2 changes: 1 addition & 1 deletion actix-cors/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ path = "src/lib.rs"

[dependencies]
actix-web = "2.0.0-rc"
actix-service = "1.0.0"
actix-service = "1.0.1"
derive_more = "0.99.2"
futures = "0.3.1"

Expand Down
2 changes: 1 addition & 1 deletion actix-files/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ path = "src/lib.rs"
[dependencies]
actix-web = { version = "2.0.0-rc", default-features = false }
actix-http = "1.0.1"
actix-service = "1.0.0"
actix-service = "1.0.1"
bitflags = "1"
bytes = "0.5.3"
futures = "0.3.1"
Expand Down
4 changes: 3 additions & 1 deletion actix-files/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,9 @@ fn directory_listing(
if dir.is_visible(&entry) {
let entry = entry.unwrap();
let p = match entry.path().strip_prefix(&dir.path) {
Ok(p) if cfg!(windows) => base.join(p).to_string_lossy().replace("\\", "/"),
Ok(p) if cfg!(windows) => {
base.join(p).to_string_lossy().replace("\\", "/")
}
Ok(p) => base.join(p).to_string_lossy().into_owned(),
Err(_) => continue,
};
Expand Down
4 changes: 2 additions & 2 deletions actix-framed/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ path = "src/lib.rs"

[dependencies]
actix-codec = "0.2.0"
actix-service = "1.0.0"
actix-service = "1.0.1"
actix-router = "0.2.0"
actix-rt = "1.0.0"
actix-http = "1.0.0"
actix-http = "1.0.1"

bytes = "0.5.3"
futures = "0.3.1"
Expand Down
2 changes: 1 addition & 1 deletion actix-http/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ failure = ["fail-ure"]
secure-cookies = ["ring"]

[dependencies]
actix-service = "1.0.0"
actix-service = "1.0.1"
actix-codec = "0.2.0"
actix-connect = "1.0.1"
actix-utils = "1.0.3"
Expand Down
2 changes: 1 addition & 1 deletion actix-identity/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ path = "src/lib.rs"

[dependencies]
actix-web = { version = "2.0.0-rc", default-features = false, features = ["secure-cookies"] }
actix-service = "1.0.0"
actix-service = "1.0.1"
futures = "0.3.1"
serde = "1.0"
serde_json = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion actix-multipart/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ path = "src/lib.rs"

[dependencies]
actix-web = { version = "2.0.0-rc", default-features = false }
actix-service = "1.0.0"
actix-service = "1.0.1"
actix-utils = "1.0.3"
bytes = "0.5.3"
derive_more = "0.99.2"
Expand Down
2 changes: 1 addition & 1 deletion actix-session/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ cookie-session = ["actix-web/secure-cookies"]

[dependencies]
actix-web = "2.0.0-rc"
actix-service = "1.0.0"
actix-service = "1.0.1"
bytes = "0.5.3"
derive_more = "0.99.2"
futures = "0.3.1"
Expand Down
2 changes: 1 addition & 1 deletion awc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ compress = ["actix-http/compress"]

[dependencies]
actix-codec = "0.2.0"
actix-service = "1.0.0"
actix-service = "1.0.1"
actix-http = "1.0.0"
actix-rt = "1.0.0"

Expand Down
87 changes: 39 additions & 48 deletions awc/tests/test_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,7 @@ async fn test_connection_reuse() {
.and_then(
HttpService::new(map_config(
App::new()
.service(web::resource("/").route(web::to(|| HttpResponse::Ok())))
.into_factory(),
.service(web::resource("/").route(web::to(|| HttpResponse::Ok()))),
|_| AppConfig::default(),
))
.tcp(),
Expand Down Expand Up @@ -210,8 +209,7 @@ async fn test_connection_force_close() {
.and_then(
HttpService::new(map_config(
App::new()
.service(web::resource("/").route(web::to(|| HttpResponse::Ok())))
.into_factory(),
.service(web::resource("/").route(web::to(|| HttpResponse::Ok()))),
|_| AppConfig::default(),
))
.tcp(),
Expand Down Expand Up @@ -239,25 +237,23 @@ async fn test_connection_server_close() {
let num = Arc::new(AtomicUsize::new(0));
let num2 = num.clone();

let srv =
test_server(move || {
let num2 = num2.clone();
pipeline_factory(move |io| {
num2.fetch_add(1, Ordering::Relaxed);
ok(io)
})
.and_then(
HttpService::new(map_config(
App::new()
.service(web::resource("/").route(web::to(|| {
HttpResponse::Ok().force_close().finish()
})))
.into_factory(),
|_| AppConfig::default(),
))
.tcp(),
)
});
let srv = test_server(move || {
let num2 = num2.clone();
pipeline_factory(move |io| {
num2.fetch_add(1, Ordering::Relaxed);
ok(io)
})
.and_then(
HttpService::new(map_config(
App::new().service(
web::resource("/")
.route(web::to(|| HttpResponse::Ok().force_close().finish())),
),
|_| AppConfig::default(),
))
.tcp(),
)
});

let client = awc::Client::default();

Expand Down Expand Up @@ -288,12 +284,9 @@ async fn test_connection_wait_queue() {
})
.and_then(
HttpService::new(map_config(
App::new()
.service(
web::resource("/")
.route(web::to(|| HttpResponse::Ok().body(STR))),
)
.into_factory(),
App::new().service(
web::resource("/").route(web::to(|| HttpResponse::Ok().body(STR))),
),
|_| AppConfig::default(),
))
.tcp(),
Expand Down Expand Up @@ -330,25 +323,23 @@ async fn test_connection_wait_queue_force_close() {
let num = Arc::new(AtomicUsize::new(0));
let num2 = num.clone();

let srv =
test_server(move || {
let num2 = num2.clone();
pipeline_factory(move |io| {
num2.fetch_add(1, Ordering::Relaxed);
ok(io)
})
.and_then(
HttpService::new(map_config(
App::new()
.service(web::resource("/").route(web::to(|| {
HttpResponse::Ok().force_close().body(STR)
})))
.into_factory(),
|_| AppConfig::default(),
))
.tcp(),
)
});
let srv = test_server(move || {
let num2 = num2.clone();
pipeline_factory(move |io| {
num2.fetch_add(1, Ordering::Relaxed);
ok(io)
})
.and_then(
HttpService::new(map_config(
App::new().service(
web::resource("/")
.route(web::to(|| HttpResponse::Ok().force_close().body(STR))),
),
|_| AppConfig::default(),
))
.tcp(),
)
});

let client = awc::Client::build()
.connector(awc::Connector::new().limit(1).finish())
Expand Down
8 changes: 3 additions & 5 deletions awc/tests/test_rustls_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,9 @@ async fn _test_connection_reuse_h2() {
.and_then(
HttpService::build()
.h2(map_config(
App::new()
.service(
web::resource("/").route(web::to(|| HttpResponse::Ok())),
)
.into_factory(),
App::new().service(
web::resource("/").route(web::to(|| HttpResponse::Ok())),
),
|_| AppConfig::default(),
))
.openssl(ssl_acceptor())
Expand Down
8 changes: 3 additions & 5 deletions awc/tests/test_ssl_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,9 @@ async fn test_connection_reuse_h2() {
.and_then(
HttpService::build()
.h2(map_config(
App::new()
.service(
web::resource("/").route(web::to(|| HttpResponse::Ok())),
)
.into_factory(),
App::new().service(
web::resource("/").route(web::to(|| HttpResponse::Ok())),
),
|_| AppConfig::default(),
))
.openssl(ssl_acceptor())
Expand Down
22 changes: 7 additions & 15 deletions src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@ use std::marker::PhantomData;
use std::sync::{Arc, Mutex};
use std::{fmt, io, net};

use actix_http::{
body::MessageBody, Error, HttpService, KeepAlive, Request, Response,
};
use actix_http::{body::MessageBody, Error, HttpService, KeepAlive, Request, Response};
use actix_server::{Server, ServerBuilder};
use actix_service::{
map_config, IntoServiceFactory, Service, ServiceFactory,
};
use actix_service::{map_config, IntoServiceFactory, Service, ServiceFactory};

use net2::TcpBuilder;

Expand Down Expand Up @@ -266,7 +262,7 @@ where
.keep_alive(c.keep_alive)
.client_timeout(c.client_timeout)
.local_addr(addr)
.finish(map_config(factory().into_factory(), move |_| cfg.clone()))
.finish(map_config(factory(), move |_| cfg.clone()))
.tcp()
},
)?;
Expand Down Expand Up @@ -313,7 +309,7 @@ where
.keep_alive(c.keep_alive)
.client_timeout(c.client_timeout)
.client_disconnect(c.client_shutdown)
.finish(map_config(factory().into_factory(), move |_| cfg.clone()))
.finish(map_config(factory(), move |_| cfg.clone()))
.openssl(acceptor.clone())
},
)?;
Expand Down Expand Up @@ -360,7 +356,7 @@ where
.keep_alive(c.keep_alive)
.client_timeout(c.client_timeout)
.client_disconnect(c.client_shutdown)
.finish(map_config(factory().into_factory(), move |_| cfg.clone()))
.finish(map_config(factory(), move |_| cfg.clone()))
.rustls(config.clone())
},
)?;
Expand Down Expand Up @@ -483,9 +479,7 @@ where
HttpService::build()
.keep_alive(c.keep_alive)
.client_timeout(c.client_timeout)
.finish(map_config(factory().into_factory(), move |_| {
config.clone()
})),
.finish(map_config(factory(), move |_| config.clone())),
)
})?;
Ok(self)
Expand Down Expand Up @@ -527,9 +521,7 @@ where
HttpService::build()
.keep_alive(c.keep_alive)
.client_timeout(c.client_timeout)
.finish(map_config(factory().into_factory(), move |_| {
config.clone()
})),
.finish(map_config(factory(), move |_| config.clone())),
)
},
)?;
Expand Down
Loading

0 comments on commit c7f3915

Please sign in to comment.