code wiki / _hdl_build / nx_host_router_test.nx
nx_host_router_test.nx
buildroot/runtime/_hdl_build/nx_host_router_test.nx
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
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
structs
| none |
consts
| none |
functions
| 8 | func 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 } |
| 9 | func 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 } |
| 10 | func 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 } |
| 12 | func t_has(hay: *u8, hn: i64, needle: *u8) -> i64 called by 1: main |
| 20 | func t_check(name: *u8, cond: i64) -> i64 |
| 24 | func t_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } called by 1: main |
| 26 | func main() -> i64 |