1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/// The URL query separator.
pub const URL_QUERY: char = '?';
/// The URL authority and path separator.
pub const URL_SLASH: char = '/';
/// The last ASCII decimal digit.
pub const ASCII_NINE: u8 = b'9';
/// The first ASCII decimal digit.
pub const ASCII_ZERO: u8 = b'0';
/// The supported cleartext HTTP URL scheme.
pub const HTTP_SCHEME: &str = "http";
/// The URL fragment separator.
pub const URL_FRAGMENT: char = '#';
/// An ambiguous special-scheme authority separator.
pub const URL_BACKSLASH: char = '\\';
/// The required HTTP URL scheme and authority delimiter.
pub const SCHEME_SEPARATOR: &str = "://";
/// The prefix identifying the response status line.
pub const HTTP_STATUS_PREFIX: & = b"HTTP/";
/// The status code offset after the HTTP-version token and its space.
pub const HTTP_STATUS_CODE_OFFSET: usize = 9;
/// The non-alphanumeric bytes allowed in an HTTP field name.
pub const FIELD_NAME_PUNCTUATION: & = b"!#$%&'*+-.^_`|~";
/// The error for a malformed outgoing header.
pub const INVALID_REQUEST_HEADER: &str = "Invalid HTTP request header";
/// The maximum accepted size of one buffered response chunk.
pub const MAX_RESPONSE_CHUNK_SIZE: usize = 64 * 1024 * 1024;
/// The maximum accepted size of an HTTP response header block.
pub const MAX_RESPONSE_HEAD_BYTES: usize = 64 * 1024;
/// The maximum accepted total size of a buffered HTTP response body.
pub const MAX_RESPONSE_BODY_BYTES: usize = 64 * 1024 * 1024;
/// The maximum number of consecutive 1xx interim responses accepted before failing.
pub const MAX_INTERIM_RESPONSES: usize = 16;
/// The error for invalid or conflicting response framing.
pub const INVALID_RESPONSE_FRAMING: &str = "Invalid or ambiguous HTTP response framing";
/// The error for an HTTP response that exceeds the configured head or body cap.
pub const RESPONSE_TOO_LARGE: &str = "HTTP response exceeds maximum allowed size";
/// The error for an excessive sequence of 1xx interim responses.
pub const TOO_MANY_INTERIM_RESPONSES: &str = "Too many interim HTTP responses";
/// The separator before a chunk extension.
pub const CHUNK_EXTENSION_SEPARATOR: u8 = b';';
/// SWAR constant with the lowest bit set in every byte lane of a `u64`.
pub const REQ_SWAR_LO_ONES: u64 = 0x0101_0101_0101_0101;
/// SWAR constant with the highest bit set in every byte lane of a `u64`.
pub const REQ_SWAR_HI_BITS: u64 = 0x8080_8080_8080_8080;
/// SWAR constant repeating `\n` across all 8 lanes of a `u64`.
pub const REQ_SWAR_LF_MASK: u64 = REQ_SWAR_LO_ONES * ;