sark-core 0.3.0

the L7 layer for dope
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::ops::Range;

#[derive(Clone, Copy, Debug)]
pub struct ParsedRequestHead<'a> {
    pub method: &'a [u8],
    pub target: &'a [u8],
    pub version: &'a [u8],
    pub headers_start: usize,
}

impl crate::http::codec::Parse {
    pub fn find_double_crlf(bytes: &[u8]) -> Option<Range<usize>> {
        memchr::memmem::find(bytes, b"\r\n\r\n").map(|s| s..s + 4)
    }
}