fix: ci
hopefully
This commit is contained in:
1 parent
b1b2fe2e4a
commit
ac7865cd35
1 file changed
+6
-14
+6
-14
@@ -55,13 +55,9 @@ pub fn configure_client_socket(stream: &TcpStream, config: &NetworkConfig) -> io
|
|||||||
let sock = socket2::SockRef::from(stream);
|
let sock = socket2::SockRef::from(stream);
|
||||||
|
|
||||||
if config.tcp_keepalive_secs > 0 {
|
if config.tcp_keepalive_secs > 0 {
|
||||||
let mut keepalive =
|
let keepalive = socket2::TcpKeepalive::new()
|
||||||
socket2::TcpKeepalive::new().with_time(Duration::from_secs(config.tcp_keepalive_secs));
|
.with_time(Duration::from_secs(config.tcp_keepalive_secs))
|
||||||
|
.with_interval(Duration::from_secs(10));
|
||||||
#[cfg(any(target_os = "linux", target_os = "android"))]
|
|
||||||
{
|
|
||||||
keepalive = keepalive.with_interval(Duration::from_secs(10));
|
|
||||||
}
|
|
||||||
|
|
||||||
if let Err(e) = sock.set_tcp_keepalive(&keepalive) {
|
if let Err(e) = sock.set_tcp_keepalive(&keepalive) {
|
||||||
debug!("Failed to set TCP keepalive on client socket: {}", e);
|
debug!("Failed to set TCP keepalive on client socket: {}", e);
|
||||||
@@ -87,13 +83,9 @@ pub fn configure_backend_socket(stream: &TcpStream, config: &NetworkConfig) -> i
|
|||||||
let sock = socket2::SockRef::from(stream);
|
let sock = socket2::SockRef::from(stream);
|
||||||
|
|
||||||
if config.tcp_keepalive_secs > 0 {
|
if config.tcp_keepalive_secs > 0 {
|
||||||
let mut keepalive =
|
let keepalive = socket2::TcpKeepalive::new()
|
||||||
socket2::TcpKeepalive::new().with_time(Duration::from_secs(config.tcp_keepalive_secs));
|
.with_time(Duration::from_secs(config.tcp_keepalive_secs))
|
||||||
|
.with_interval(Duration::from_secs(10));
|
||||||
#[cfg(any(target_os = "linux", target_os = "android"))]
|
|
||||||
{
|
|
||||||
keepalive = keepalive.with_interval(Duration::from_secs(10));
|
|
||||||
}
|
|
||||||
|
|
||||||
if let Err(e) = sock.set_tcp_keepalive(&keepalive) {
|
if let Err(e) = sock.set_tcp_keepalive(&keepalive) {
|
||||||
debug!("Failed to set TCP keepalive on backend socket: {}", e);
|
debug!("Failed to set TCP keepalive on backend socket: {}", e);
|
||||||
|
|||||||
Reference in new issue
Block a user