Skip to content

Commit

Permalink
feat(swarm): deprecated keep_alive_timeout from OneShotHandlerConfig
Browse files Browse the repository at this point in the history
Related: #3844.
Related: #4677

Pull-Request: #4680.
  • Loading branch information
leonzchang authored Oct 17, 2023
1 parent 411824a commit 203e11c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions swarm/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
Individual protocols should not keep connections alive for longer than necessary.
Users should use `swarm::Config::idle_connection_timeout` instead.
See [PR 4656](https://github.com/libp2p/rust-libp2p/pull/4656).
- Deprecate `keep_alive_timeout` in `OneShotHandlerConfig`.
See [PR 4680](https://github.com/libp2p/rust-libp2p/pull/4680).

[PR 4120]: https://github.com/libp2p/rust-libp2p/pull/4120

Expand Down
4 changes: 4 additions & 0 deletions swarm/src/handler/one_shot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,9 @@ where
#[derive(Debug)]
pub struct OneShotHandlerConfig {
/// Keep-alive timeout for idle connections.
#[deprecated(
note = "Set a global idle connection timeout via `SwarmBuilder::idle_connection_timeout` instead."
)]
pub keep_alive_timeout: Duration,
/// Timeout for outbound substream upgrades.
pub outbound_substream_timeout: Duration,
Expand All @@ -241,6 +244,7 @@ pub struct OneShotHandlerConfig {
}

impl Default for OneShotHandlerConfig {
#[allow(deprecated)]
fn default() -> Self {
OneShotHandlerConfig {
keep_alive_timeout: Duration::from_secs(10),
Expand Down

0 comments on commit 203e11c

Please sign in to comment.