code wiki / _hdl_build / nx_http_chunked_gate.nx
nx_http_chunked_gate.nx
buildroot/runtime/_hdl_build/nx_http_chunked_gate.nx
about
nx_http_chunked_gate.nx -- GATE for nx_http_chunked (M2 unblock: decode HF's chunked API responses). Proves
with hand-built fixtures (CRLF = bytes 13,10, no reliance on "\r" literal support):
T1 single chunk "5\r\nhello\r\n0\r\n\r\n" -> "hello"
T2 multi chunk "3\r\nabc\r\n3\r\ndef\r\n0\r\n\r\n" -> "abcdef"
T3 chunk extension "5;x=y\r\nhello\r\n0\r\n\r\n" -> "hello" (extension tolerated)
T4 header detect hc_is_chunked("Transfer-Encoding: chunked")==1 ; Content-Length header==0
T5 malformed size a body with no hex size -> -1 (never fabricates a decode)
GREEN iff T1-T5 pass. Sovereign nx_cc->nxasm. expect_exit: 0 license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_http_chunked.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
| 12 | func w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 13 | func wn(v: i64) -> i64 { var m: i64=v; if m<0{w("-" as *u8);m=0-m} let t:*u8=sys_mmap(24); var k:i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i:i64=0; let o:*u8=sys_mmap(24); while i<k{o[i]=t[k-1-i];i=i+1} sys_write(1,o,k); return 0 } |
| 14 | func puts(dst: *u8, off: i64, s: *u8) -> i64 { var o: i64=off; var i: i64=0; while s[i]!=(0 as u8){dst[o]=s[i];o=o+1;i=i+1} return o } called by 1: main |
| 15 | func crlf(dst: *u8, off: i64) -> i64 { dst[off]=13 as u8; dst[off+1]=10 as u8; return off+2 } called by 1: main |
| 16 | func memeq(a: *u8, b: *u8, n: i64) -> i64 { var i: i64=0; while i<n { if a[i]!=b[i] { return 0 } i=i+1 } return 1 } called by 1: main |
| 18 | func main() -> i64 |