Sfoglia il codice sorgente

update actix-service dep

master
Nikolay Kim 9 mesi fa
parent
commit
c7f3915779
16 ha cambiato i file con 76 aggiunte e 101 eliminazioni
  1. +2
    -2
      Cargo.toml
  2. +1
    -1
      actix-cors/Cargo.toml
  3. +1
    -1
      actix-files/Cargo.toml
  4. +3
    -1
      actix-files/src/lib.rs
  5. +2
    -2
      actix-framed/Cargo.toml
  6. +1
    -1
      actix-http/Cargo.toml
  7. +1
    -1
      actix-identity/Cargo.toml
  8. +1
    -1
      actix-multipart/Cargo.toml
  9. +1
    -1
      actix-session/Cargo.toml
  10. +1
    -1
      awc/Cargo.toml
  11. +39
    -48
      awc/tests/test_client.rs
  12. +3
    -5
      awc/tests/test_rustls_client.rs
  13. +3
    -5
      awc/tests/test_ssl_client.rs
  14. +7
    -15
      src/server.rs
  15. +9
    -15
      src/test.rs
  16. +1
    -1
      test-server/Cargo.toml

+ 2
- 2
Cargo.toml Vedi File

@@ -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"


+ 1
- 1
actix-cors/Cargo.toml Vedi File

@@ -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"



+ 1
- 1
actix-files/Cargo.toml Vedi File

@@ -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"


+ 3
- 1
actix-files/src/lib.rs Vedi File

@@ -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,
};


+ 2
- 2
actix-framed/Cargo.toml Vedi File

@@ -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"


+ 1
- 1
actix-http/Cargo.toml Vedi File

@@ -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"


+ 1
- 1
actix-identity/Cargo.toml Vedi File

@@ -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"


+ 1
- 1
actix-multipart/Cargo.toml Vedi File

@@ -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"


+ 1
- 1
actix-session/Cargo.toml Vedi File

@@ -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"


+ 1
- 1
awc/Cargo.toml Vedi File

@@ -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"



+ 39
- 48
awc/tests/test_client.rs Vedi File

@@ -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())


+ 3
- 5
awc/tests/test_rustls_client.rs Vedi File

@@ -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())


+ 3
- 5
awc/tests/test_ssl_client.rs Vedi File

@@ -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())


+ 7
- 15
src/server.rs Vedi File

@@ -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())),
)
},
)?;


+ 9
- 15
src/test.rs Vedi File

@@ -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())
}),
},


+ 1
- 1
test-server/Cargo.toml Vedi File

@@ -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"


Caricamento…
Annulla
Salva