nx_range_header.nx
buildroot/runtime/nx_range_header.nx
about
Native byte-range parsing, RFC 9110 sections 14.1.1 and 14.1.2.
Negative outcomes retain caller output. Serving policy owns HTTP status selection.
dependencies 1 imports · 2 importers
imports: nx_syscalls.nx
imported by: nx_host_router.nxnx_range_header_gate.nx
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| 10 | struct RangeSpec { start: i64, end: i64, } |
consts
| 4 | const RH_ERR_FORMAT: i64 = -1 |
| 5 | const RH_ERR_UNIT: i64 = -2 |
| 6 | const RH_ERR_OVERFLOW: i64 = -3 // caller's range-array capacity |
| 7 | const RH_ERR_UNSATISFIABLE: i64 = -4 |
| 8 | const RH_EMPTY_REPRESENTATION: i64 = -5 |
| 9 | const RH_ERR_NUMBER: i64 = -6 // legacy integer helper cannot represent the numeral |
functions
| 11 | func rh_is_digit(b: i64) -> i64 { return ((b>=48)&&(b<=57)) as i64 } called by 1: rh_parse_pass |
| 12 | func rh_ows(b: i64) -> i64 { return ((b==32)||(b==9)) as i64 } |
| 15 | func rh_parse_uint(buf: *u8, off: *i64, end: i64) -> i64 called by 1: main |
| 30 | func rh_bounded(buf: *u8,off: *i64,n: i64,limit: i64) -> i64 called by 1: rh_parse_pass |
| 43 | func rh_decimal_cmp(buf: *u8,a: i64,ae: i64,b: i64,be: i64) -> i64 called by 1: rh_parse_pass |
| 51 | func rh_nonzero(buf: *u8,a: i64,b: i64) -> i64 called by 1: rh_parse_pass |
| 55 | func rh_parse_pass(buf: *u8,n: i64,total: i64,ranges: *RangeSpec,cap: i64,pos: *i64) -> i64 |
| 107 | func range_parse(buf: *u8,n: i64,total_size: i64,ranges: *RangeSpec,cap: i64) -> i64 |
| 118 | func main() -> i64 |