Skip to content

Commit

Permalink
build: fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
LEXUGE committed Mar 13, 2022
1 parent 68d8656 commit 03fbd49
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
3 changes: 2 additions & 1 deletion droute/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ tokio-native-tls = { version = "^0.3", optional = true }
tokio-rustls = { version = "^0.23", optional = true }

# TCP keepalive doesn't help us pool our connections, sadly
socket2 = {version = "^0.4"}
socket2 = {version = "^0.4", features = ["all"]}

# Async-aware dependencies
futures = "^0.3"
Expand Down Expand Up @@ -83,4 +83,5 @@ skip_optional_dependencies = true

skip_feature_sets = [
["doh-rustls", "doh-native-tls"],
["dot-rustls", "dot-native-tls"],
]
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,7 @@ impl ConnInitiator for Tls {
async fn create(&self) -> std::io::Result<Self::Connection> {
let mut stream = TcpStream::connect(self.addr).await?;

let keepalive = TcpKeepalive::new()
.with_time(std::time::Duration::from_secs(3))
.with_interval(std::time::Duration::from_secs(5))
.with_retries(5);
let keepalive = TcpKeepalive::new().with_time(std::time::Duration::from_secs(3));
let socket: Socket = stream.into_std()?.into();
socket.set_tcp_keepalive(&keepalive)?;
stream = TcpStream::from_std(socket.into())?;
Expand Down
5 changes: 1 addition & 4 deletions droute/src/router/upstreams/upstream/qhandle/tls-rustls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,7 @@ impl ConnInitiator for Tls {
async fn create(&self) -> std::io::Result<Self::Connection> {
let mut stream = TcpStream::connect(self.addr).await?;

let keepalive = TcpKeepalive::new()
.with_time(std::time::Duration::from_secs(3))
.with_interval(std::time::Duration::from_secs(5))
.with_retries(5);
let keepalive = TcpKeepalive::new().with_time(std::time::Duration::from_secs(3));
let socket: Socket = stream.into_std()?.into();
socket.set_tcp_keepalive(&keepalive)?;
stream = TcpStream::from_std(socket.into())?;
Expand Down

0 comments on commit 03fbd49

Please sign in to comment.