mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-13 01:51:23 +00:00
Rename KeepAlive constructors. (#1078)
* KeepAlive::Now => KeepAlive::No * KeepAlive::Forever => KeepAlive::Yes As suggested in #1072.
This commit is contained in:
committed by
Pierre Krieger
parent
5c34f8a0ed
commit
8cde987e6d
@ -90,7 +90,7 @@ where
|
||||
|
||||
#[inline]
|
||||
fn connection_keep_alive(&self) -> KeepAlive {
|
||||
KeepAlive::Now
|
||||
KeepAlive::No
|
||||
}
|
||||
|
||||
fn poll(
|
||||
|
@ -127,9 +127,9 @@ where
|
||||
#[inline]
|
||||
fn connection_keep_alive(&self) -> KeepAlive {
|
||||
if self.first_id_happened {
|
||||
KeepAlive::Now
|
||||
KeepAlive::No
|
||||
} else {
|
||||
KeepAlive::Forever
|
||||
KeepAlive::Yes
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -326,7 +326,7 @@ where
|
||||
allow_listening,
|
||||
next_connec_unique_id: UniqueConnecId(0),
|
||||
substreams: Vec::new(),
|
||||
keep_alive: KeepAlive::Forever,
|
||||
keep_alive: KeepAlive::Yes,
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -525,7 +525,7 @@ where
|
||||
if self.substreams.is_empty() {
|
||||
self.keep_alive = KeepAlive::Until(Instant::now() + Duration::from_secs(10));
|
||||
} else {
|
||||
self.keep_alive = KeepAlive::Forever;
|
||||
self.keep_alive = KeepAlive::Yes;
|
||||
}
|
||||
|
||||
Ok(Async::NotReady)
|
||||
|
@ -202,7 +202,7 @@ where
|
||||
// the connection may be closed. I.e. the ping handler does not keep
|
||||
// the connection alive, it merely adds another condition (failed pings)
|
||||
// for terminating it.
|
||||
KeepAlive::Now
|
||||
KeepAlive::No
|
||||
}
|
||||
|
||||
fn poll(&mut self) -> Poll<ProtocolsHandlerEvent<protocol::Ping, (), PingResult>, Self::Error> {
|
||||
|
Reference in New Issue
Block a user