Skip to content

Commit

Permalink
code review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
neonphog committed Feb 2, 2024
1 parent 7608bfa commit 430e250
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/tx5-go-pion/src/evt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ use std::sync::{Arc, Mutex};
use tx5_go_pion_sys::Event as SysEvent;
use tx5_go_pion_sys::API;

const WEBRTC_MAX_DATA_PACKET_SIZE: usize = 16 * 1024;

/// PeerConnectionState events.
#[derive(Debug)]
pub enum PeerConnectionState {
Expand Down Expand Up @@ -360,7 +362,7 @@ static MANAGER: Lazy<Mutex<Manager>> = Lazy::new(|| {
data_chan,
async {
let len = buf.len()?;
if len > 16 * 1024 {
if len > WEBRTC_MAX_DATA_PACKET_SIZE {
return Err(Error::id("MsgTooLarge"));
}

Expand Down

0 comments on commit 430e250

Please sign in to comment.