Skip to content

Commit 516b667

Browse files
authored
Merge pull request #39 from dariusc93/patch-1
protocol/max_buf_size: Increase max size to 2MB
2 parents 81c0e6d + ef54578 commit 516b667

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/compat/protocol.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ use futures::io::{AsyncRead, AsyncWrite, AsyncWriteExt};
44
use libp2p::core::{upgrade, InboundUpgrade, OutboundUpgrade, UpgradeInfo};
55
use std::{io, iter};
66

7-
// Undocumented, but according to JS we our messages have a max size of 512*1024
8-
// https://github.com/ipfs/js-ipfs-bitswap/blob/d8f80408aadab94c962f6b88f343eb9f39fa0fcc/src/decision-engine/index.js#L16
9-
const MAX_BUF_SIZE: usize = 524_288;
7+
// 2MB Block Size according to the specs at https://github.com/ipfs/specs/blob/main/BITSWAP.md
8+
const MAX_BUF_SIZE: usize = 2_097_152;
109

1110
#[derive(Clone, Debug, Default)]
1211
pub struct CompatProtocol;

0 commit comments

Comments
 (0)