-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clients: feature gate tls
#545
Conversation
3b39d60
to
2d9020a
Compare
#[derive(Debug, Copy, Clone)] | ||
pub enum EitherStream<S, T> { | ||
#[derive(Debug)] | ||
pub enum EitherStream { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did this but I realized I can just used placeholder type such as ()
to keep the generics here not sure that we need the generics anyway.
Unless we plan to support any transport using tokio rustls
:)
for _ in 0..self.max_redirections { | ||
tracing::debug!("Connecting to target: {:?}", target); | ||
|
||
// The sockaddrs might get reused if the server replies with a relative URI. | ||
let sockaddrs = std::mem::take(&mut target.sockaddrs); | ||
for sockaddr in &sockaddrs { | ||
let tcp_stream = match connect(*sockaddr, self.timeout, &target.host, &tls_connector).await { | ||
#[cfg(feature = "tls")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to do this to avoid feature gate the entire method.
tls
|
||
[features] | ||
default = ["tls"] | ||
tls = ["hyper-rustls/webpki-tokio"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, do we have CI that tests with different features on and off?
yeah, we have this which should compile each crate with |
jsonrpsee-types = { path = "../types", version = "0.6.0" } | ||
jsonrpsee-utils = { path = "../utils", version = "0.6.0", features = ["client", "http-helpers"] } | ||
serde = { version = "1.0", default-features = false, features = ["derive"] } | ||
serde_json = "1.0" | ||
thiserror = "1.0" | ||
tokio = { version = "1.8", features = ["time"] } | ||
tracing = "0.1" | ||
url = "2.2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will close #554
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Closing #241