Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core/swarm] Refactor and extend configurable connection limits. #1848

Merged
merged 6 commits into from
Nov 23, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# 0.25.0 [unreleased]

- New configurable connection limits for established connections and
dedicated connection counters. Removed the connection limit dedicated
to outgoing pending connection _per peer_. Connection limits are now
represented by `u32` intead of `usize` types.
romanb marked this conversation as resolved.
Show resolved Hide resolved

- Update `multihash`.

- Update `multistream-select`.
Expand Down
5 changes: 3 additions & 2 deletions core/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ pub use listeners::{ListenerId, ListenersStream, ListenersEvent};
pub use manager::ConnectionId;
pub use substream::{Substream, SubstreamEndpoint, Close};
pub use pool::{EstablishedConnection, EstablishedConnectionIter, PendingConnection};
pub use pool::{ConnectionLimits, ConnectionCounters};

use crate::muxing::StreamMuxer;
use crate::{Multiaddr, PeerId};
Expand Down Expand Up @@ -326,9 +327,9 @@ impl<'a> OutgoingInfo<'a> {
#[derive(Debug, Clone)]
pub struct ConnectionLimit {
/// The maximum number of connections.
pub limit: usize,
pub limit: u32,
/// The current number of connections.
pub current: usize,
pub current: u32,
}

impl fmt::Display for ConnectionLimit {
Expand Down
Loading