code wiki / _hdl_build / nx_mgmt_upload.nx
nx_mgmt_upload.nx
buildroot/runtime/_hdl_build/nx_mgmt_upload.nx
about
nx_mgmt_upload.nx -- CAP-API-UPLOAD: the #1 census gap = binary UPLOAD over /api, the "not-on-LAN deploy"
unblocker. The mgmt accept loop reads one request into a fixed SD_REQCAP(64KB) buffer, so a multi-MB binary
cannot ride a single POST. Answer: CHUNKED staging -- the client sends ordered ~48KB `POST /api/upload?target=..&seq=N`
chunks; this primitive assembles them into the allowlisted staging file (seq 0 = fresh/truncate, seq>0 = append),
then /api/deploy promotes + the self-safe marker (nx_deploy_marker) restarts. Deterministic + resumable-by-seq.
SECURITY: `path` MUST be pre-resolved through the deploy allowlist (md_resolve_target) by the caller -- this is the
write primitive only, single-responsibility. license_tier: ORIGINAL
dependencies 1 imports · 1 importers
imports: nx_syscalls.nx
imported by: nx_mgmt_api.nx
structs
| none |
consts
| 9 | const MU_MAGIC_3750763034362895579: i64 = 3750763034362895579 |
| 10 | const MU_MAGIC_65536: i64 = 65536 |
| 11 | const MU_MAGIC_1099511628211: i64 = 1099511628211 |
| 13 | const MU_MODE: i64 = 0x1a4 // 0644 |
functions
| 16 | func mu_stage_chunk(path: *u8, seq: i64, chunk: *u8, chunk_n: i64) -> i64 |
| 27 | func mu_staged_size(path: *u8) -> i64 |
| 37 | func mu_staged_fnv1a(path: *u8) -> i64 |