code wiki / _hdl_build / nx_http_chunked_gate.nx

nx_http_chunked_gate.nx

buildroot/runtime/_hdl_build/nx_http_chunked_gate.nx

4748 B68 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind gate/prooftopic http
docsdependenciesstructsconstsfunctions

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

nx_http_chunked.nx nx_syscalls.nx nx_http_chunked_gate.nx

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

main w sys_write sys_mmap puts crlf chunked_decode hc_hexval memeq wn w ↻ sys_mmap ↻ sys_write ↻ hc_is_chunked hc_has sys_exit

structs

none

consts

none

functions

12func 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: wnmain calls 1: sys_write
13func 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 }
called by 1: main calls 3: wsys_mmapsys_write
14func 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
15func crlf(dst: *u8, off: i64) -> i64 { dst[off]=13 as u8; dst[off+1]=10 as u8; return off+2 }
called by 1: main
16func 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
18func main() -> i64