code wiki / _hdl_build / nx_loop_http.nx
nx_loop_http.nx
buildroot/runtime/_hdl_build/nx_loop_http.nx
about
nx_loop_http.nx -- sovereign plain-HTTP loopback probe (NO shell curl): connect 127.0.0.1:<port>, GET <path>,
print "status=<code> ct=<content-type> bytes=<n>" + the first 200 body bytes. For verifying the reader daemon's
routes ON THE NAS via nx_reader_diag (the reader terminates plain HTTP on :8791; TLS is at the proxy). Reusable.
nx_loop_http <port> <path>
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_connect.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
| 7 | const K_MAGIC_4096: i64 = 4096 |
| 8 | const K_MAGIC_2097152: i64 = 2097152 |
functions
| 10 | func lw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 11 | func ln(v: i64) -> i64 { let b: *u8=sys_mmap(24); var m: i64=v; if m<0{lw("-" 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; while i<k{b[i]=t[k-1-i];i=i+1} sys_write(1,b,k); return 0 } |
| 12 | func lslen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 13 | func latoi(s: *u8) -> i64 { var v: i64=0; var i: i64=0; while s[i]!=(0 as u8){ let c: i64=s[i] as i64; if c>=48 { if c<=57 { v=v*10+(c-48) } } i=i+1 } return v } called by 1: main |
| 15 | func main(argc: i64, argv: *i64) -> i64 |