mirror of
https://github.com/actix/actix-extras.git
synced 2024-11-23 15:51:06 +01:00
update actix-service dep
This commit is contained in:
parent
f45db1f909
commit
c7f3915779
@ -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"
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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,
|
||||
};
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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(),
|
||||
@ -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(),
|
||||
@ -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();
|
||||
|
||||
@ -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(),
|
||||
@ -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())
|
||||
|
@ -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())
|
||||
|
@ -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())
|
||||
|
@ -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;
|
||||
|
||||
@ -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()
|
||||
},
|
||||
)?;
|
||||
@ -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())
|
||||
},
|
||||
)?;
|
||||
@ -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())
|
||||
},
|
||||
)?;
|
||||
@ -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)
|
||||
@ -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())),
|
||||
)
|
||||
},
|
||||
)?;
|
||||
|
24
src/test.rs
24
src/test.rs
@ -634,7 +634,7 @@ where
|
||||
AppConfig::new(false, local_addr, format!("{}", local_addr));
|
||||
HttpService::build()
|
||||
.client_timeout(ctimeout)
|
||||
.h1(map_config(factory().into_factory(), move |_| cfg.clone()))
|
||||
.h1(map_config(factory(), move |_| cfg.clone()))
|
||||
.tcp()
|
||||
}),
|
||||
HttpVer::Http2 => builder.listen("test", tcp, move || {
|
||||
@ -642,7 +642,7 @@ where
|
||||
AppConfig::new(false, local_addr, format!("{}", local_addr));
|
||||
HttpService::build()
|
||||
.client_timeout(ctimeout)
|
||||
.h2(map_config(factory().into_factory(), move |_| cfg.clone()))
|
||||
.h2(map_config(factory(), move |_| cfg.clone()))
|
||||
.tcp()
|
||||
}),
|
||||
HttpVer::Both => builder.listen("test", tcp, move || {
|
||||
@ -650,9 +650,7 @@ where
|
||||
AppConfig::new(false, local_addr, format!("{}", local_addr));
|
||||
HttpService::build()
|
||||
.client_timeout(ctimeout)
|
||||
.finish(map_config(factory().into_factory(), move |_| {
|
||||
cfg.clone()
|
||||
}))
|
||||
.finish(map_config(factory(), move |_| cfg.clone()))
|
||||
.tcp()
|
||||
}),
|
||||
},
|
||||
@ -663,7 +661,7 @@ where
|
||||
AppConfig::new(true, local_addr, format!("{}", local_addr));
|
||||
HttpService::build()
|
||||
.client_timeout(ctimeout)
|
||||
.h1(map_config(factory().into_factory(), move |_| cfg.clone()))
|
||||
.h1(map_config(factory(), move |_| cfg.clone()))
|
||||
.openssl(acceptor.clone())
|
||||
}),
|
||||
HttpVer::Http2 => builder.listen("test", tcp, move || {
|
||||
@ -671,7 +669,7 @@ where
|
||||
AppConfig::new(true, local_addr, format!("{}", local_addr));
|
||||
HttpService::build()
|
||||
.client_timeout(ctimeout)
|
||||
.h2(map_config(factory().into_factory(), move |_| cfg.clone()))
|
||||
.h2(map_config(factory(), move |_| cfg.clone()))
|
||||
.openssl(acceptor.clone())
|
||||
}),
|
||||
HttpVer::Both => builder.listen("test", tcp, move || {
|
||||
@ -679,9 +677,7 @@ where
|
||||
AppConfig::new(true, local_addr, format!("{}", local_addr));
|
||||
HttpService::build()
|
||||
.client_timeout(ctimeout)
|
||||
.finish(map_config(factory().into_factory(), move |_| {
|
||||
cfg.clone()
|
||||
}))
|
||||
.finish(map_config(factory(), move |_| cfg.clone()))
|
||||
.openssl(acceptor.clone())
|
||||
}),
|
||||
},
|
||||
@ -692,7 +688,7 @@ where
|
||||
AppConfig::new(true, local_addr, format!("{}", local_addr));
|
||||
HttpService::build()
|
||||
.client_timeout(ctimeout)
|
||||
.h1(map_config(factory().into_factory(), move |_| cfg.clone()))
|
||||
.h1(map_config(factory(), move |_| cfg.clone()))
|
||||
.rustls(config.clone())
|
||||
}),
|
||||
HttpVer::Http2 => builder.listen("test", tcp, move || {
|
||||
@ -700,7 +696,7 @@ where
|
||||
AppConfig::new(true, local_addr, format!("{}", local_addr));
|
||||
HttpService::build()
|
||||
.client_timeout(ctimeout)
|
||||
.h2(map_config(factory().into_factory(), move |_| cfg.clone()))
|
||||
.h2(map_config(factory(), move |_| cfg.clone()))
|
||||
.rustls(config.clone())
|
||||
}),
|
||||
HttpVer::Both => builder.listen("test", tcp, move || {
|
||||
@ -708,9 +704,7 @@ where
|
||||
AppConfig::new(true, local_addr, format!("{}", local_addr));
|
||||
HttpService::build()
|
||||
.client_timeout(ctimeout)
|
||||
.finish(map_config(factory().into_factory(), move |_| {
|
||||
cfg.clone()
|
||||
}))
|
||||
.finish(map_config(factory(), move |_| cfg.clone()))
|
||||
.rustls(config.clone())
|
||||
}),
|
||||
},
|
||||
|
@ -30,7 +30,7 @@ default = []
|
||||
openssl = ["open-ssl", "awc/openssl"]
|
||||
|
||||
[dependencies]
|
||||
actix-service = "1.0.0"
|
||||
actix-service = "1.0.1"
|
||||
actix-codec = "0.2.0"
|
||||
actix-connect = "1.0.0"
|
||||
actix-utils = "1.0.3"
|
||||
|
Loading…
Reference in New Issue
Block a user