mirror of
https://github.com/fafhrd91/actix-web
synced 2024-11-30 10:42:55 +01:00
use new new service api
This commit is contained in:
parent
2f89b12f4f
commit
b80ee71785
20
Cargo.toml
20
Cargo.toml
@ -37,10 +37,18 @@ session = ["cookie/secure"]
|
||||
ssl = ["openssl", "actix-connector/ssl"]
|
||||
|
||||
[dependencies]
|
||||
actix-service = "0.2.1"
|
||||
#actix-service = "0.2.1"
|
||||
actix-codec = "0.1.0"
|
||||
actix-connector = "0.2.0"
|
||||
actix-utils = "0.2.2"
|
||||
#actix-connector = "0.2.0"
|
||||
#actix-utils = "0.2.2"
|
||||
|
||||
actix-service = { git = "https://github.com/actix/actix-net" }
|
||||
actix-connector = { git = "https://github.com/actix/actix-net" }
|
||||
actix-utils = { git = "https://github.com/actix/actix-net" }
|
||||
|
||||
#actix-service = { path = "../actix-net/actix-service" }
|
||||
#actix-connector = { path = "../actix-net/actix-connector" }
|
||||
#actix-utils = { path = "../actix-net/actix-utils" }
|
||||
|
||||
base64 = "0.10"
|
||||
backtrace = "0.3"
|
||||
@ -78,8 +86,10 @@ openssl = { version="0.10", optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
actix-rt = "0.1.0"
|
||||
actix-server = { version="0.2", features=["ssl"] }
|
||||
actix-connector = { version="0.2.0", features=["ssl"] }
|
||||
actix-server = { git = "https://github.com/actix/actix-net", features=["ssl"] }
|
||||
#actix-server = { path = "../actix-net/actix-server", features=["ssl"] }
|
||||
#actix-connector = { path = "../actix-net/actix-connector", features=["ssl"] }
|
||||
actix-connector = { git = "https://github.com/actix/actix-net", features=["ssl"] }
|
||||
actix-http-test = { path="test-server", features=["ssl"] }
|
||||
env_logger = "0.6"
|
||||
serde_derive = "1.0"
|
||||
|
@ -67,9 +67,9 @@ where
|
||||
type Service = H1ServiceHandler<T, S::Service, B>;
|
||||
type Future = H1ServiceResponse<T, S, B>;
|
||||
|
||||
fn new_service(&self) -> Self::Future {
|
||||
fn new_service(&self, _: &()) -> Self::Future {
|
||||
H1ServiceResponse {
|
||||
fut: self.srv.new_service(),
|
||||
fut: self.srv.new_service(&()),
|
||||
cfg: Some(self.cfg.clone()),
|
||||
_t: PhantomData,
|
||||
}
|
||||
@ -309,7 +309,7 @@ where
|
||||
type Service = OneRequestService<T>;
|
||||
type Future = FutureResult<Self::Service, Self::InitError>;
|
||||
|
||||
fn new_service(&self) -> Self::Future {
|
||||
fn new_service(&self, _: &()) -> Self::Future {
|
||||
ok(OneRequestService {
|
||||
config: self.config.clone(),
|
||||
_t: PhantomData,
|
||||
|
@ -70,9 +70,9 @@ where
|
||||
type Service = H2ServiceHandler<T, S::Service, B>;
|
||||
type Future = H2ServiceResponse<T, S, B>;
|
||||
|
||||
fn new_service(&self) -> Self::Future {
|
||||
fn new_service(&self, _: &()) -> Self::Future {
|
||||
H2ServiceResponse {
|
||||
fut: self.srv.new_service(),
|
||||
fut: self.srv.new_service(&()),
|
||||
cfg: Some(self.cfg.clone()),
|
||||
_t: PhantomData,
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ where
|
||||
type Service = SendError<T, R, E>;
|
||||
type Future = FutureResult<Self::Service, Self::InitError>;
|
||||
|
||||
fn new_service(&self) -> Self::Future {
|
||||
fn new_service(&self, _: &()) -> Self::Future {
|
||||
ok(SendError(PhantomData))
|
||||
}
|
||||
}
|
||||
@ -142,7 +142,7 @@ where
|
||||
type Service = SendResponse<T, B>;
|
||||
type Future = FutureResult<Self::Service, Self::InitError>;
|
||||
|
||||
fn new_service(&self) -> Self::Future {
|
||||
fn new_service(&self, _: &()) -> Self::Future {
|
||||
ok(SendResponse(PhantomData))
|
||||
}
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ impl<T> NewService for VerifyWebSockets<T> {
|
||||
type Service = VerifyWebSockets<T>;
|
||||
type Future = FutureResult<Self::Service, Self::InitError>;
|
||||
|
||||
fn new_service(&self) -> Self::Future {
|
||||
fn new_service(&self, _: &()) -> Self::Future {
|
||||
ok(VerifyWebSockets { _t: PhantomData })
|
||||
}
|
||||
}
|
||||
|
@ -33,12 +33,16 @@ ssl = ["openssl", "actix-http/ssl", "actix-server/ssl"]
|
||||
|
||||
[dependencies]
|
||||
actix-codec = "0.1"
|
||||
actix-service = "0.2.0"
|
||||
actix-rt = "0.1.0"
|
||||
actix-server = "0.2.0"
|
||||
actix-utils = "0.2.0"
|
||||
actix-http = { path=".." }
|
||||
|
||||
#actix-service = "0.2.0"
|
||||
#actix-server = "0.2.0"
|
||||
#actix-utils = "0.2.0"
|
||||
actix-service = { git = "https://github.com/actix/actix-net" }
|
||||
actix-server = { git = "https://github.com/actix/actix-net" }
|
||||
actix-utils = { git = "https://github.com/actix/actix-net" }
|
||||
|
||||
base64 = "0.10"
|
||||
bytes = "0.4"
|
||||
cookie = { version="0.11", features=["percent-encode"] }
|
||||
|
@ -514,7 +514,6 @@ fn test_body_chunked_implicit() {
|
||||
let body = once::<_, Error>(Ok(Bytes::from_static(STR.as_ref())));
|
||||
ok::<_, ()>(Response::Ok().streaming(body))
|
||||
})
|
||||
.map(|_| ())
|
||||
});
|
||||
|
||||
let req = srv.get().finish().unwrap();
|
||||
@ -537,7 +536,6 @@ fn test_response_http_error_handling() {
|
||||
.body(STR),
|
||||
)
|
||||
})
|
||||
.map(|_| ())
|
||||
});
|
||||
|
||||
let req = srv.get().finish().unwrap();
|
||||
|
Loading…
Reference in New Issue
Block a user