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" either = "1.5.3"
futures-util = { version = "0.3.4", default-features = false } futures-util = { version = "0.3.4", default-features = false }
# FIXME: Use release version # 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" log = "0.4"
# FIXME: Use release version # FIXME: Use release version
trust-dns-proto = { git = "https://github.com/bluejekyll/trust-dns", branch = "main", default-features = false, features = ["tokio-runtime"] } 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" "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 }); actix_rt::spawn(Signals { srv, streams });
} }
} }

View File

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