Skip to content

Commit

Permalink
fix: set default network timeout as config.connection_timeout_ms in…
Browse files Browse the repository at this point in the history
…stead of zero
  • Loading branch information
Ddystopia committed Feb 26, 2025
1 parent 49c3b5f commit e13ccfb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions rumqttd/src/link/bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ async fn network_connect<P: Protocol>(
config.connections.max_payload_size,
config.connections.max_inflight_count,
protocol,
Duration::from_millis(config.connections.connection_timeout_ms as u64),
))
}
#[cfg(feature = "use-rustls")]
Expand All @@ -185,6 +186,7 @@ async fn network_connect<P: Protocol>(
config.connections.max_payload_size,
config.connections.max_inflight_count,
protocol,
Duration::from_millis(config.connections.connection_timeout_ms as u64),
))
}
#[cfg(not(feature = "use-rustls"))]
Expand Down
3 changes: 2 additions & 1 deletion rumqttd/src/link/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,15 @@ impl<P: Protocol> Network<P> {
max_incoming_size: usize,
max_connection_buffer_len: usize,
protocol: P,
keepalive: Duration,
) -> Network<P> {
Network {
socket,
read: BytesMut::with_capacity(10 * 1024),
write: BytesMut::with_capacity(10 * 1024),
max_incoming_size,
max_connection_buffer_len,
keepalive: Duration::ZERO,
keepalive,
protocol,
}
}
Expand Down
1 change: 1 addition & 0 deletions rumqttd/src/server/broker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,7 @@ async fn remote<P: Protocol>(
config.max_payload_size,
config.max_inflight_count,
protocol,
Duration::from_millis(config.connection_timeout_ms as u64),
);

let dynamic_filters = config.dynamic_filters;
Expand Down

0 comments on commit e13ccfb

Please sign in to comment.