code wiki / _hdl_build / nx_sovgit_serve.nx
nx_sovgit_serve.nx
buildroot/runtime/_hdl_build/nx_sovgit_serve.nx
about
nx_sovgit_serve.nx -- ★SOVGIT rung X1c: a minimal SOVEREIGN HTTP server (built on nx_http_server sockets, NO nginx/
framework) that serves our bare git repo over git's DUMB-HTTP protocol, so a STOCK `git clone http://HOST:18690/`
round-trips over the NETWORK. On startup it assembles the repo (X0 objects + refs + HEAD + config + dumb info/refs +
objects/info/packs), then accept-loops serving files statically. Reuses nx_sovgit_obj (X0/X1a). Runs forever (a test
harness launches it in the background, clones, then kills it). license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_sovgit_obj.nxnx_http_server.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
| 8 | const K_MAGIC_18690: i64 = 18690 |
| 9 | const K_MAGIC_65536: i64 = 65536 |
| 10 | const K_MAGIC_262144: i64 = 262144 |
functions
| 12 | func lg(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(2, s, n); return 0 } called by 1: main |
| 13 | func scopy(dst: *u8, at: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { dst[at + i] = s[i]; i = i + 1 } return at + i } |
| 14 | func udec(out: *u8, at: i64, v: i64) -> i64 called by 1: serve |
| 20 | func wfile(path: *u8, buf: *u8, n: i64) -> i64 { let fd: i64 = sys_openat_wr(path, 0x1a4); if fd < 0 { return 0 - 1 } sys_write(fd, buf, n); sys_close(fd); return 0 } |
| 21 | func wstr(path: *u8, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return wfile(path, s, n) } |
| 23 | func assemble_repo() -> i64 |
| 50 | func serve(cfd: i64, relpath: *u8, rlen: i64, resp: *u8) -> i64 |
| 78 | func main() -> i64 |