update http crate override

This commit is contained in:
fakeshadow 2020-12-15 21:59:00 +08:00
parent 8fcaa1160f
commit c7790bd3e0
4 changed files with 51 additions and 31 deletions

View File

@ -40,7 +40,7 @@ derive_more = "0.99.2"
either = "1.5.3"
futures-util = { version = "0.3.4", default-features = false }
# FIXME: Use release version
http = { git = "https://github.com/paolobarbolini/http.git", branch = "bytes06", optional = true }
http = { git = "https://github.com/fakeshadow/http.git", optional = true }
log = "0.4"
# FIXME: Use release version
trust-dns-proto = { git = "https://github.com/bluejekyll/trust-dns", branch = "main", default-features = false, features = ["tokio-runtime"] }

View File

@ -112,3 +112,29 @@ fn join_current_arbiter() {
"local_join should await only for the already spawned futures"
);
}
#[test]
fn non_static_block_on() {
let string = String::from("test_str");
let str = string.as_str();
let sys = actix_rt::System::new("borrow some");
sys.block_on(async {
actix_rt::time::sleep(Duration::from_millis(1)).await;
assert_eq!("test_str", str);
});
let rt = actix_rt::Runtime::new().unwrap();
rt.block_on(async {
actix_rt::time::sleep(Duration::from_millis(1)).await;
assert_eq!("test_str", str);
});
actix_rt::System::run(|| {
assert_eq!("test_str", str);
actix_rt::System::current().stop();
})
.unwrap();
}

View File

@ -58,7 +58,7 @@ impl Signals {
),
}
}
actix_rt::spawn(Signals { srv, streams });
}
}

View File

@ -183,17 +183,14 @@ impl<T: ServiceFactory> PipelineFactory<T> {
factory: F,
) -> PipelineFactory<
impl ServiceFactory<
Request = T::Request,
Response = U::Response,
Error = T::Error,
Config = T::Config,
InitError = T::InitError,
Service = impl Service<
Request = T::Request,
Response = U::Response,
Error = T::Error,
> + Clone,
> + Clone,
Request = T::Request,
Response = U::Response,
Error = T::Error,
Config = T::Config,
InitError = T::InitError,
Service = impl Service<Request = T::Request, Response = U::Response, Error = T::Error>
+ Clone,
> + Clone,
>
where
Self: Sized,
@ -221,13 +218,13 @@ impl<T: ServiceFactory> PipelineFactory<T> {
f: F,
) -> PipelineFactory<
impl ServiceFactory<
Request = T::Request,
Response = Res,
Error = Err,
Config = T::Config,
InitError = T::InitError,
Service = impl Service<Request = T::Request, Response = Res, Error = Err> + Clone,
> + Clone,
Request = T::Request,
Response = Res,
Error = Err,
Config = T::Config,
InitError = T::InitError,
Service = impl Service<Request = T::Request, Response = Res, Error = Err> + Clone,
> + Clone,
>
where
Self: Sized,
@ -254,17 +251,14 @@ impl<T: ServiceFactory> PipelineFactory<T> {
factory: F,
) -> PipelineFactory<
impl ServiceFactory<
Request = T::Request,
Response = U::Response,
Error = T::Error,
Config = T::Config,
InitError = T::InitError,
Service = impl Service<
Request = T::Request,
Response = U::Response,
Error = T::Error,
> + Clone,
> + Clone,
Request = T::Request,
Response = U::Response,
Error = T::Error,
Config = T::Config,
InitError = T::InitError,
Service = impl Service<Request = T::Request, Response = U::Response, Error = T::Error>
+ Clone,
> + Clone,
>
where
Self: Sized,