code wiki / _hdl_build / nx_vroom.nx

nx_vroom.nx

buildroot/runtime/_hdl_build/nx_vroom.nx

9270 B216 linesdepth 1pulls 1 transitivereach 2 importersview sourcekind librarytopic vroom
docsdependenciesstructsconstsfunctions

about

nx_vroom.nx -- the sovereign video-room request HANDLER (the daemon's brain), kept separate from sockets/TLS so it is unit-gateable. Composes nx_room_relay (per-room peer frames) into HTTP responses for the relay routes: POST /video/post?room=R&id=N body=frame -> rr_post, "200 ok" GET /video/frames?room=R&id=N -> octet body of OTHER peers' frames as length-prefixed records: [id u64 LE][len u32 LE][frame bytes]* GET /video/roster?room=R&id=N -> JSON [id,id,...] Returns response length in `out`, or 0 if the route isn't a relay route (the TLS/fork shell then serves the static page / client.wasm / 404). Server-relay = ZERO WebRTC/STUN/TURN. All flag-style loops (no break/continue in nested ifs -- that miscompiles and hangs, per the sites-daemon note). license_tier: ORIGINAL

dependencies 1 imports · 2 importers

nx_room_relay.nx nx_vroom.nx nx_vroom_daemon.nx nx_vroom_gate.nx

imports: nx_room_relay.nx

imported by: nx_vroom_daemon.nxnx_vroom_gate.nx

structs

none

consts

14const K_MAGIC_2166136261: i64 = 2166136261
15const K_MAGIC_16777619: i64 = 16777619

functions

17func vr_strlen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 2: vr_appsmain
18func vr_lower(c: u8) -> u8 { if c >= (65 as u8) { if c <= (90 as u8) { return c + (32 as u8) } } return c }
20func vr_contains(hay: *u8, hlen: i64, needle: *u8, nlen: i64) -> i64
35func vr_body_start(hay: *u8, hlen: i64) -> i64
44func vr_content_length(req: *u8, reqn: i64) -> i64
73func vr_room_hash(req: *u8, reqn: i64) -> i64
104func vr_id(req: *u8, reqn: i64) -> i64
131func vr_app(dst: *u8, off: i64, src: *u8, n: i64) -> i64 { var i: i64=0; while i<n { dst[off+i]=src[i]; i=i+1 } return off+n }
called by 2: vr_appsvr_handle
132func vr_apps(dst: *u8, off: i64, s: *u8) -> i64 { return vr_app(dst, off, s, vr_strlen(s)) }
called by 1: vr_handle calls 2: vr_appvr_strlen
133func vr_wu64(dst: *u8, off: i64, v: i64) -> i64 { var i: i64=0; while i<8 { dst[off+i]=((v >> (i*8)) & 0xff) as u8; i=i+1 } return off+8 }
134func vr_wu32(dst: *u8, off: i64, v: i64) -> i64 { var i: i64=0; while i<4 { dst[off+i]=((v >> (i*8)) & 0xff) as u8; i=i+1 } return off+4 }
135func vr_wdec(dst: *u8, off: i64, v: i64) -> i64
called by 1: vr_handle
145func vr_handle(plain: *u8, plain_n: i64, rr_st: *i64, rr_arena: *u8, now: i64, ttl: i64,