pub struct Http1Config {
pub max_request_line_size: usize,
pub max_header_size: usize,
pub max_header_count: usize,
pub max_body_size: usize,
pub keep_alive: bool,
pub max_header_name_len: usize,
pub max_header_value_len: usize,
pub idle_timeout_ms: u64,
pub max_buffer_size: usize,
}Expand description
HTTP/1.1 解析器配置
Fields§
§max_request_line_size: usize最大请求行大小(字节)
max_header_size: usize最大请求头大小(字节)
max_header_count: usize最大请求头数量
max_body_size: usize最大请求体大小(字节)
keep_alive: bool是否启用 keep-alive
max_header_name_len: usize每个头部名称最大长度
max_header_value_len: usize每个头部值最大长度
idle_timeout_ms: u64请求空闲超时(毫秒),防止 Slowloris 慢速攻击
max_buffer_size: usize解析器内部缓冲区最大容量(字节),累积未完成请求的上限
Implementations§
Source§impl Http1Config
impl Http1Config
Sourcepub fn with_max_header_size(self, size: usize) -> Self
pub fn with_max_header_size(self, size: usize) -> Self
设置最大头部大小
Sourcepub fn with_max_body_size(self, size: usize) -> Self
pub fn with_max_body_size(self, size: usize) -> Self
设置最大请求体大小
Sourcepub fn with_max_header_count(self, n: usize) -> Self
pub fn with_max_header_count(self, n: usize) -> Self
设置最大头部数量
Sourcepub fn with_idle_timeout_ms(self, ms: u64) -> Self
pub fn with_idle_timeout_ms(self, ms: u64) -> Self
设置空闲超时(毫秒),防止 Slowloris 慢速攻击
Sourcepub fn with_max_buffer_size(self, size: usize) -> Self
pub fn with_max_buffer_size(self, size: usize) -> Self
设置解析器缓冲区最大容量(字节)
Trait Implementations§
Source§impl Clone for Http1Config
impl Clone for Http1Config
Source§fn clone(&self) -> Http1Config
fn clone(&self) -> Http1Config
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Http1Config
impl Debug for Http1Config
Auto Trait Implementations§
impl Freeze for Http1Config
impl RefUnwindSafe for Http1Config
impl Send for Http1Config
impl Sync for Http1Config
impl Unpin for Http1Config
impl UnsafeUnpin for Http1Config
impl UnwindSafe for Http1Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more