Skip to content

Commit c8eff60

Browse files
increase webrtc max message size from 16kiB to 256kiB
1 parent f38fb5c commit c8eff60

File tree

12 files changed

+31
-16
lines changed

12 files changed

+31
-16
lines changed

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ libp2p-tcp = { version = "0.42.0", path = "transports/tcp" }
109109
libp2p-tls = { version = "0.5.0", path = "transports/tls" }
110110
libp2p-uds = { version = "0.41.0", path = "transports/uds" }
111111
libp2p-upnp = { version = "0.3.0", path = "protocols/upnp" }
112-
libp2p-webrtc = { version = "0.8.0-alpha", path = "transports/webrtc" }
113-
libp2p-webrtc-utils = { version = "0.3.0", path = "misc/webrtc-utils" }
114-
libp2p-webrtc-websys = { version = "0.4.0-alpha.2", path = "transports/webrtc-websys" }
112+
libp2p-webrtc = { version = "0.9.0-alpha", path = "transports/webrtc" }
113+
libp2p-webrtc-utils = { version = "0.4.0", path = "misc/webrtc-utils" }
114+
libp2p-webrtc-websys = { version = "0.5.0-alpha", path = "transports/webrtc-websys" }
115115
libp2p-websocket = { version = "0.44.0", path = "transports/websocket" }
116116
libp2p-websocket-websys = { version = "0.4.0", path = "transports/websocket-websys" }
117117
libp2p-webtransport-websys = { version = "0.4.0", path = "transports/webtransport-websys" }

misc/webrtc-utils/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 0.4.0
2+
3+
- Increase WebRTC max message size from 16 KiB to 256 KiB.
4+
See [PR 5589](https://github.com/libp2p/rust-libp2p/pull/5589)
5+
16
## 0.3.0
27

38
<!-- Update to libp2p-swarm v0.45.0 -->

misc/webrtc-utils/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ license = "MIT"
77
name = "libp2p-webrtc-utils"
88
repository = "https://github.com/libp2p/rust-libp2p"
99
rust-version = { workspace = true }
10-
version = "0.3.0"
10+
version = "0.4.0"
1111
publish = true
1212

1313
[dependencies]

misc/webrtc-utils/src/sdp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ a=ice-pwd:{pwd}
9090
a=fingerprint:{fingerprint_algorithm} {fingerprint_value}
9191
a=setup:passive
9292
a=sctp-port:5000
93-
a=max-message-size:16384
93+
a=max-message-size:262144
9494
a=candidate:1467250027 1 UDP 1467250027 {target_ip} {target_port} typ host
9595
a=end-of-candidates
9696
";

misc/webrtc-utils/src/stream.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,11 @@ mod state;
4141

4242
/// Maximum length of a message.
4343
///
44-
/// "As long as message interleaving is not supported, the sender SHOULD limit the maximum message
45-
/// size to 16 KB to avoid monopolization."
46-
/// Source: <https://www.rfc-editor.org/rfc/rfc8831#name-transferring-user-data-on-a>
47-
pub const MAX_MSG_LEN: usize = 16 * 1024;
44+
/// See:
45+
/// <https://github.com/libp2p/specs/pull/628>
46+
/// <https://blog.mozilla.org/webrtc/large-data-channel-messages/>
47+
/// <https://issues.webrtc.org/issues/40644524>
48+
pub const MAX_MSG_LEN: usize = 256 * 1024; // 256 KiB
4849
/// Length of varint, in bytes.
4950
const VARINT_LEN: usize = 2;
5051
/// Overhead of the protobuf encoding, in bytes.

transports/webrtc-websys/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 0.5.0-alpha
2+
3+
- Increase WebRTC max message size from 16 KiB to 256 KiB.
4+
See [PR 5589](https://github.com/libp2p/rust-libp2p/pull/5589)
5+
16
## 0.4.0-alpha.2
27

38
- Bump version of web-sys and update `__Nonexhaustive` to `__Invalid`.

transports/webrtc-websys/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ license = "MIT"
88
name = "libp2p-webrtc-websys"
99
repository = "https://github.com/libp2p/rust-libp2p"
1010
rust-version = { workspace = true }
11-
version = "0.4.0-alpha.2"
11+
version = "0.5.0-alpha"
1212
publish = true
1313

1414
[dependencies]

transports/webrtc-websys/src/connection.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ mod sdp_tests {
298298

299299
#[test]
300300
fn test_fingerprint() {
301-
let sdp = "v=0\r\no=- 0 0 IN IP6 ::1\r\ns=-\r\nc=IN IP6 ::1\r\nt=0 0\r\na=ice-lite\r\nm=application 61885 UDP/DTLS/SCTP webrtc-datachannel\r\na=mid:0\r\na=setup:passive\r\na=ice-ufrag:libp2p+webrtc+v1/YwapWySn6fE6L9i47PhlB6X4gzNXcgFs\r\na=ice-pwd:libp2p+webrtc+v1/YwapWySn6fE6L9i47PhlB6X4gzNXcgFs\r\na=fingerprint:sha-256 A8:17:77:1E:02:7E:D1:2B:53:92:70:A6:8E:F9:02:CC:21:72:3A:92:5D:F4:97:5F:27:C4:5E:75:D4:F4:31:89\r\na=sctp-port:5000\r\na=max-message-size:16384\r\na=candidate:1467250027 1 UDP 1467250027 ::1 61885 typ host\r\n";
301+
let sdp = "v=0\r\no=- 0 0 IN IP6 ::1\r\ns=-\r\nc=IN IP6 ::1\r\nt=0 0\r\na=ice-lite\r\nm=application 61885 UDP/DTLS/SCTP webrtc-datachannel\r\na=mid:0\r\na=setup:passive\r\na=ice-ufrag:libp2p+webrtc+v1/YwapWySn6fE6L9i47PhlB6X4gzNXcgFs\r\na=ice-pwd:libp2p+webrtc+v1/YwapWySn6fE6L9i47PhlB6X4gzNXcgFs\r\na=fingerprint:sha-256 A8:17:77:1E:02:7E:D1:2B:53:92:70:A6:8E:F9:02:CC:21:72:3A:92:5D:F4:97:5F:27:C4:5E:75:D4:F4:31:89\r\na=sctp-port:5000\r\na=max-message-size:262144\r\na=candidate:1467250027 1 UDP 1467250027 ::1 61885 typ host\r\n";
302302

303303
let fingerprint = parse_fingerprint(sdp).unwrap();
304304

transports/webrtc/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.9.0-alpha
2+
- Increase WebRTC max message size from 16 KiB to 256 KiB.
3+
See [PR 5589](https://github.com/libp2p/rust-libp2p/pull/5589)
4+
15
## 0.8.0-alpha
26

37
- Implement refactored `Transport`.

0 commit comments

Comments
 (0)