code wiki / (root) / nx_http_post.nx

nx_http_post.nx

buildroot/runtime/nx_http_post.nx

3124 B48 linesdepth 6pulls 9 transitivereach 0 importersview sourcekind tooltopic http
docsdependenciesstructsconstsfunctions

about

nx_http_post.nx -- sovereign HTTP POST probe (retires Invoke-WebRequest -Method POST for login/api flow tests). Composes nx_http_client's POST request builder + sockaddr, plus a read-to-EOF drain. Usage: nx_http_post <path> <body> [expect-substring] [port] Content-Type application/x-www-form-urlencoded. Prints "POST <path> -> status=<code> bytes=<n>" + FOUND/MISSING. No shell. license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_http_client.nx nx_connect.nx nx_gate.nx nx_http_post.nx

imports: nx_http_client.nxnx_connect.nxnx_gate.nx

imported by: nobody (leaf or entry point)

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

main gw sys_write hp_atoi hp_strlen nx_http_client_sockaddr_ip sys_socket nx_connect_bounded nx_fcntl sys_connect sys_mmap sys_poll nx_http_client_build_reque nx_dec_emit_u63 hp_drain sys_read gn sys_write ↻ sys_mmap ↻ hp_contains

structs

none

consts

9const K_MAGIC_8080: i64 = 8080
10const K_MAGIC_8192: i64 = 8192
11const K_MAGIC_4194304: i64 = 4194304

functions

13func hp_strlen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 1: main
14func hp_atoi(buf: *u8, off: i64, len: i64) -> i64 { var v: i64=0; var i: i64=0; while i<len { let d: i64=buf[off+i] as i64; if d>=48 { if d<=57 { v=v*10+(d-48) } else { i=len } } else { i=len } i=i+1 } return v }
called by 1: main
15func hp_contains(buf: *u8, n: i64, needle: *u8) -> i64 { var nl: i64=0; while needle[nl]!=(0 as u8){nl=nl+1} if nl==0 {return 1} var i: i64=0; while i+nl<=n { var m: i64=1; var j: i64=0; while j<nl { if buf[i+j]!=needle[j] {m=0;j=nl} else {j=j+1} } if m==1 {return 1} i=i+1 } return 0 }
called by 1: main
16func hp_drain(fd: i64, buf: *u8, cap: i64) -> i64 { var off: i64=0; var go: i64=1; while go==1 { if off>=cap { go=0 } else { let r: i64=sys_read(fd, ((buf as i64)+off) as *u8, cap-off); if r<=0 { go=0 } else { off=off+r } } } return off }
called by 1: main calls 1: sys_read
18func main(argc: i64, argv: *i64) -> i64