code wiki / _hdl_build / nx_host_router_test.nx

nx_host_router_test.nx

buildroot/runtime/_hdl_build/nx_host_router_test.nx

5549 B86 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind gate/prooftopic host
docsdependenciesstructsconstsfunctions

about

nx_host_router_test.nx -- ENGINEER gate for the config-driven host router. Real files on disk, real request bytes; proves: (1) Host-> doc-root routing, (2) per-request file serve = HOT content, (3) path-traversal rejected, (4) unknown host + missing file = 404, (5) MIME by extension, (6) LIVE hot-swap -- rewrite the file, re-serve, see new bytes with NO recompile. license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_host_router.nx nx_syscalls.nx nx_host_router_test.nx

imports: nx_host_router.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main t_wr sys_openat_wr sys_write sys_close t_slen sys_mmap hr_serve sys_mmap ↻ hr_req_host hr_ieq hr_lower hr_lower ↻ hr_req_path hr_lookup_root hr_eq hr_copy hr_emit hr_putdec sys_mmap ↻ hr_slen hr_path_safe hr_resolve sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close ↻ hr_ctype hr_ieq ↻ t_check t_puts sys_write ↻ t_has hr_resolve ↻ t_puts ↻ t_pn sys_mmap ↻ hr_putdec ↻

structs

none

consts

none

functions

8func t_puts(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: t_checkmain calls 1: sys_write
9func t_pn(v: i64) -> i64 { let b: *u8=sys_mmap(28); let nn: i64=hr_putdec(b,v); sys_write(1,b,nn); return 0 }
called by 1: main calls 3: sys_mmaphr_putdecsys_write
10func t_wr(path: *u8, data: *u8, n: i64) -> i64 { let fd: i64=sys_openat_wr(path,0x1a4); if fd<0{return 0-1} sys_write(fd,data,n); sys_close(fd); return 0 }
12func t_has(hay: *u8, hn: i64, needle: *u8) -> i64
called by 1: main
20func t_check(name: *u8, cond: i64) -> i64
called by 1: main calls 1: t_puts
24func t_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 1: main
26func main() -> i64