Skip to content
Merged
Changes from 1 commit
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
Next Next commit
libp2p-kad: Increase default max packet size.
For better interoperability by default, picking up the
suggestion in #1622.
  • Loading branch information
Roman S. Borschel committed Sep 7, 2020
commit f519fee977e678b651e9678b2ab40013a8c72b43
5 changes: 4 additions & 1 deletion protocols/kad/src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ use wasm_timer::Instant;
/// The protocol name used for negotiating with multistream-select.
pub const DEFAULT_PROTO_NAME: &[u8] = b"/ipfs/kad/1.0.0";

/// The default maximum size for a varint length-delimited packet.
pub const DEFAULT_MAX_PACKET_SIZE: usize = 16 * 1024;

/// Status of our connection to a node reported by the Kademlia protocol.
#[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)]
pub enum KadConnectionType {
Expand Down Expand Up @@ -167,7 +170,7 @@ impl Default for KademliaProtocolConfig {
fn default() -> Self {
KademliaProtocolConfig {
protocol_name: Cow::Borrowed(DEFAULT_PROTO_NAME),
max_packet_size: 4096,
max_packet_size: DEFAULT_MAX_PACKET_SIZE,
}
}
}
Expand Down