code wiki / _hdl_build / nx_pub_serve.nx
nx_pub_serve.nx
buildroot/runtime/_hdl_build/nx_pub_serve.nx
about
nx_pub_serve.nx -- PUB-SERVE R0: the publisher's OWN sovereign static-content HTTP server. It serves the
publisher's liveroot as static files (GET /<path> -> liveroot/<path>), so PUBLISHING IS A FILE-DROP + SERVE
-- NO sites.elf daemon-swap, no live-touching a fragile compiled daemon. New content = a new file in liveroot,
served immediately. Sovereign (our own socket syscalls + HTTP/1.1 text; no nginx/3rd-party). Path-traversal
is refused at the boundary (rule #12). This is the rung that lets THE PUBLISHER manage serving end to end.
usage: nx_pub_serve <liveroot> <port>. Exposes psv_listen() so a gate can fork it on loopback. license_tier: ORIGINAL
dependencies 2 imports · 4 importers
imports: nx_syscalls.nxnx_publisher.nx
imported by: nx_hostop_serve_gate.nxnx_pub_canary_gate.nxnx_pub_serve_gate.nxnx_pub_smoke_gate.nx
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 9 | const K_MAGIC_1024: i64 = 1024 |
| 10 | const K_MAGIC_1280: i64 = 1280 |
| 11 | const K_MAGIC_16384: i64 = 16384 |
| 12 | const K_MAGIC_18620: i64 = 18620 |
functions
| 15 | func psv_path(req: *u8, rn: i64, out: *u8) -> i64 called by 1: psv_handle |
| 39 | func psv_safe(path: *u8) -> i64 called by 1: psv_handle |
| 47 | func psv_send_ok(cfd: i64, data: *u8, len: i64) -> i64 |
| 56 | func psv_send_status(cfd: i64, code: i64, msg: *u8) -> i64 |
| 64 | func psv_handle(cfd: i64, liveroot: *u8, req: *u8, rn: i64) -> i64 |
| 77 | func psv_listen(liveroot: *u8, port: i64) -> i64 called by 5: mainmainmainmainmain calls 12: sys_mmapsys_socketsys_setsockoptsys_bindsys_listensys_accept+6 |
| 109 | func main(argc: i64, argv: *i64) -> i64 calls 1: psv_listen |