code wiki / _hdl_build / nx_cleanserve_resolve.nx

nx_cleanserve_resolve.nx

buildroot/runtime/_hdl_build/nx_cleanserve_resolve.nx

2684 B40 linesdepth 22pulls 173 transitivereach 1 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_cleanserve_resolve.nx -- shared last-resort media-resolve helpers for the clean-serve daemon + nx_cleanview. Extracted so the URL parser is GATE-TESTABLE (a bug here = a broken <video src> the deploy health-check can't catch). No state, no network -- pure parsing over a sniff plan + a cheap page pre-check. Co-located in _hdl_build with nx_video_sniff.nx (its dependency) so imports resolve. license_tier: ORIGINAL

dependencies 3 imports · 1 importers

nx_syscalls.nx nx_video_sniff.nx nx_video_sniff_fetch.nx nx_cleanserve_resolve.nx nx_cleanserve_resolve_gate.nx

imports: nx_syscalls.nxnx_video_sniff.nxnx_video_sniff_fetch.nx

imported by: nx_cleanserve_resolve_gate.nx

structs

none

consts

9const CSD_SNIFF_CPU_SECS: i64 = 2 // JS-exec resolve is CPU-bounded; only fires when static extraction found nothing on a video-ish page
10const CSD_MAXSRC: i64 = 6 // bounded external <script src> bundles fetched per request -- DoS-amplification guard for the PUBLIC route (1 req !-> unbounded outbound)
11const CSD_SRCCAP: i64 = 65536 // <script src> list buffer
12const CSD_EXTCAP: i64 = 4194304 // 4 MiB total concat of fetched bundle bodies fed to the JS-VM
13const CSD_BUNCAP: i64 = 4194304 // 4 MiB per-bundle fetch buffer

functions

16func csd_plan_url(plan: *u8, out: *u8, cap: i64) -> i64
called by 1: main
31func csd_looks_videoish(body: *u8, blen: i64) -> i64
called by 1: main calls 1: mjx_contains