#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub(crate) struct XmlLimits {
pub(crate) max_bytes: usize,
pub(crate) max_nodes: u32,
pub(crate) max_depth: u16,
pub(crate) max_attributes: u16,
}
impl XmlLimits {
pub(crate) const ENVELOPE: Self = Self {
max_bytes: 4 * 1024 * 1024,
max_nodes: 20_000,
max_depth: 64,
max_attributes: 64,
};
pub(crate) const SMP: Self = Self {
max_bytes: 2 * 1024 * 1024,
max_nodes: 20_000,
max_depth: 64,
max_attributes: 64,
};
pub(crate) const fn payload(max_bytes: usize) -> Self {
Self {
max_bytes,
max_nodes: 4_000_000,
max_depth: 256,
max_attributes: 256,
}
}
}
pub(crate) const MAX_C14N_DEPTH: u16 = 256;