code wiki / (root) / nx_http_range_req.nx

nx_http_range_req.nx

buildroot/runtime/nx_http_range_req.nx

4381 B72 linesdepth 2pulls 2 transitivereach 325 importersview sourcekind tooltopic http
docsdependenciesstructsconstsfunctions

about

nx_http_range_req.nx -- ADDITIVE HTTP/1.1 Range request builder (RFC 9110 Section 14.2) -- the first piece of CC-content fetch: to pull ONE Common Crawl record you request its byte-slice of the multi-GB .warc.gz via "Range: bytes=START-END". Mirrors nx_http_client_build_request but adds the Range header (additive; existing builder untouched). Gate verifies the exact request for the real example.com CC record (offset 176519143, length 946). The follow-on wires this into the TLS fetch + gz-member inflate (nx_deflate) -> real CC record. license_tier: ORIGINAL

dependencies 1 imports · 1 importers

nx_syscalls.nx nx_http_range_req.nx nx_https_fetch_follow.nx

imports: nx_syscalls.nx

imported by: nx_https_fetch_follow.nx

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap nx_http_build_range_get rr_app rr_appn rr_u64 sys_mmap ↻ rr_w sys_write sys_write ↻ rr_chk rr_w ↻ rr_find sys_exit

structs

none

consts

7const K_MAGIC_4096: i64 = 4096
8const K_MAGIC_176519143: i64 = 176519143
9const K_MAGIC_176520088: i64 = 176520088

functions

11func rr_app(out: *u8, o: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){ out[o]=s[i]; o=o+1; i=i+1 } return o }
12func rr_appn(out: *u8, o: i64, s: *u8, n: i64) -> i64 { var i: i64=0; while i<n { out[o]=s[i]; o=o+1; i=i+1 } return o }
13func rr_u64(out: *u8, o: i64, v: i64) -> i64
called by 1: nx_http_build_range_get calls 1: sys_mmap
23func nx_http_build_range_get(path: *u8, path_len: i64, host: *u8, host_len: i64, rstart: i64, rend: i64, out: *u8) -> i64
called by 1: main calls 3: rr_apprr_appnrr_u64
38func rr_find(hay: *u8, hn: i64, needle: *u8) -> i64
called by 1: main
45func rr_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 2: rr_chkmain calls 1: sys_write
46func rr_chk(cond: i64, name: *u8, acc: *i64) -> i64 { acc[1]=acc[1]+1; if cond==1 { acc[0]=acc[0]+1; rr_w(" PASS " as *u8) } else { rr_w(" FAIL " as *u8) } rr_w(name); rr_w("\n" as *u8); return 0 }
called by 1: main calls 1: rr_w
48func main() -> i64