code wiki / _hdl_build / nx_browser_fetch_probe.nx

nx_browser_fetch_probe.nx

buildroot/runtime/_hdl_build/nx_browser_fetch_probe.nx

2320 B38 linesdepth 22pulls 133 transitivereach 0 importersview sourcekind probetopic browser
docsdependenciesstructsconstsfunctions

about

nx_browser_fetch_probe.nx -- proves the render-front header fix: fetch a URL that bot-blocked our plain client (Google's video bucket 403'd nx_https_fetch_follow) using nx_https_get_spoof (real Firefox UA + browser Accept headers). If it now returns 200 + the media bytes, presenting as a browser is what beats the block -- the keystone for capturing media from hosts that reject non-browser clients. Run from nxc2 root. ORIGINAL

dependencies 5 imports · 0 importers

nx_syscalls.nx nx_x509_trust_store.nx nx_trust_store_load_from_certdata. nx_csprng.nx nx_https_get_spoof.nx nx_browser_fetch_probe.nx

imports: nx_syscalls.nxnx_x509_trust_store.nxnx_trust_store_load_from_certdata.nxnx_csprng.nxnx_https_get_spoof.nx

imported by: nobody (leaf or entry point)

structs

none

consts

10const K_MAGIC_4194304: i64 = 4194304
11const K_MAGIC_8388608: i64 = 8388608

functions

13func pw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 1: pn calls 1: sys_write
14func pn(v: i64) -> i64 { let b: *u8=sys_mmap(24); var m: i64=v; if m<0{pw("-" as *u8);m=0-m} let t: *u8=sys_mmap(24); var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i: i64=0; while i<k{b[i]=t[k-1-i];i=i+1} sys_write(1,b,k); return 0 }
16func main(argc: i64, argv: *i64) -> i64