Skip to content

Commit 140ea8e

Browse files
committed
CHORE: Remove keep-alive
1 parent 93492e6 commit 140ea8e

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

src/behaviour.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,13 @@ pub trait BitswapStore: Send + Sync + 'static {
7474
pub struct BitswapConfig {
7575
/// Timeout of a request.
7676
pub request_timeout: Duration,
77-
/// Time a connection is kept alive.
78-
pub connection_keep_alive: Duration,
7977
}
8078

8179
impl BitswapConfig {
8280
/// Creates a new `BitswapConfig`.
8381
pub fn new() -> Self {
8482
Self {
8583
request_timeout: Duration::from_secs(10),
86-
connection_keep_alive: Duration::from_secs(10),
8784
}
8885
}
8986
}
@@ -127,10 +124,8 @@ pub struct Bitswap<P: StoreParams> {
127124
impl<P: StoreParams> Bitswap<P> {
128125
/// Creates a new `Bitswap` behaviour.
129126
pub fn new<S: BitswapStore<Params = P>>(config: BitswapConfig, store: S) -> Self {
130-
let mut rr_config = request_response::Config::default();
131-
// TODO: If we want to set this one we need to use SwarmBuilder::set_idle_timeout
132-
// rr_config.set_connection_keep_alive(config.connection_keep_alive);
133-
rr_config = rr_config.with_request_timeout(config.request_timeout);
127+
let rr_config =
128+
request_response::Config::default().with_request_timeout(config.request_timeout);
134129
let protocols = std::iter::once((BitswapProtocol, ProtocolSupport::Full));
135130
let inner = request_response::Behaviour::with_codec(
136131
BitswapCodec::<P>::default(),

0 commit comments

Comments
 (0)