code wiki / _hdl_build / nx_archive_resolve.nx

nx_archive_resolve.nx

buildroot/runtime/_hdl_build/nx_archive_resolve.nx

2738 B32 linesdepth 3pulls 3 transitivereach 1 importersview sourcekind librarytopic archive
docsdependenciesstructsconstsfunctions

about

nx_archive_resolve.nx -- SERVE-FROM-ARCHIVE, the payoff that connects preservation to the search engine: given a URL whose origin has rotted, build a proper HTTP response serving the PRESERVED copy from the WARC (correct Content-Type, byte-exact body, flagged X-Nishi-Archive: preserved) -- or a 404 if it was never captured. The search engine links results through a resolver endpoint that tries the live origin and falls back to this on 404, so indexed media never dies. Additive: this touches nothing in the search core. ORIGINAL

dependencies 2 imports · 1 importers

nx_syscalls.nx nx_web_archive.nx nx_archive_resolve.nx nx_archive_resolve_gate.nx

imports: nx_syscalls.nxnx_web_archive.nx

imported by: nx_archive_resolve_gate.nx

structs

none

consts

none

functions

9func ar_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 1: ar_build_response
10func ar_puts(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){dst[off]=s[i];off=off+1;i=i+1} return off }
called by 1: ar_build_response
11func ar_putn(dst: *u8, off: i64, v: i64) -> i64 { var m: i64=v; if m==0 { dst[off]=48 as u8; return off+1 } let t: *u8=sys_mmap(24); var k: i64=0; while m>0 { t[k]=(48+(m%10)) as u8; m=m/10; k=k+1 } var j: i64=0; while j<k { dst[off]=t[k-1-j]; off=off+1; j=j+1 } return off }
called by 1: ar_build_response calls 1: sys_mmap
14func ar_build_response(warc: *u8, warclen: i64, url: *u8, ulen: i64, out: *u8, cap: i64) -> i64