pub struct ServerLimits {
pub chunk: ChunkLimits,
pub amf0: Amf0Limits,
pub max_command_len: usize,
pub max_failed_publish_attempts: u32,
}Expand description
The bounds a ServerSession holds its peer to. The crate supplies none of them.
Fields§
§chunk: ChunkLimitsThe chunk reassembly bounds (message length, chunk streams, total in-progress bytes, announced chunk size; #1108/RTMP-W1).
amf0: Amf0LimitsThe AMF0 depth and value-count bounds command parsing is held to.
max_command_len: usizeLargest inbound Command Message body parsed. A command body is decoded into a full AMF0
value tree before any state-machine check (including the connect stream-key gate), so
without this bound one reassembled message of one-byte nulls or three-byte empty-key
pairs expands into millions of allocations. A longer body is rejected with
RtmpError::CommandTooLong before any AMF0 parsing.
max_failed_publish_attempts: u32Number of publish attempts with a mismatched stream key tolerated on one connection
before the session is closed: expected_stream_key is the only secret in the ingest
path, and one TCP connection can otherwise retry publish with a new guess indefinitely.
Implementations§
Source§impl ServerLimits
impl ServerLimits
Sourcepub fn for_profile(profile: Profile) -> Self
pub fn for_profile(profile: Profile) -> Self
The Profile preset, replaceable through its with_* setters.
Sourcepub fn with_chunk(self, value: ChunkLimits) -> Self
pub fn with_chunk(self, value: ChunkLimits) -> Self
Replace Self::chunk.
Sourcepub fn with_amf0(self, value: Amf0Limits) -> Self
pub fn with_amf0(self, value: Amf0Limits) -> Self
Replace Self::amf0.
Sourcepub fn with_max_command_len(self, value: usize) -> Self
pub fn with_max_command_len(self, value: usize) -> Self
Replace Self::max_command_len.
Sourcepub fn with_max_failed_publish_attempts(self, value: u32) -> Self
pub fn with_max_failed_publish_attempts(self, value: u32) -> Self
Replace Self::max_failed_publish_attempts.
Trait Implementations§
Source§impl Clone for ServerLimits
impl Clone for ServerLimits
impl Copy for ServerLimits
Source§impl Debug for ServerLimits
impl Debug for ServerLimits
Source§impl<'de> Deserialize<'de> for ServerLimits
Available on crate feature serde only.
impl<'de> Deserialize<'de> for ServerLimits
serde only.Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ServerLimits
Source§impl PartialEq for ServerLimits
impl PartialEq for ServerLimits
Source§impl Serialize for ServerLimits
Available on crate feature serde only.
impl Serialize for ServerLimits
serde only.