code wiki / (root) / nx_https_ka_probe.nx

nx_https_ka_probe.nx

buildroot/runtime/nx_https_ka_probe.nx

9822 B158 linesdepth 19pulls 121 transitivereach 0 importersview sourcekind probetopic https
docsdependenciesstructsconstsfunctions

about

nx_https_ka_probe.nx -- R4 ISOLATED PROOF: HTTP/1.1 KEEP-ALIVE connection reuse over ONE TLS session. Operator 2026-07-01 chose R4 (connection reuse). nx_https_get_complete has 30 callers -> CANNOT modify it. So this is a SELF-CONTAINED probe that replicates the send/read loop with a "Connection: keep-alive" request and sends TWO GETs over ONE handshake -> proves the ~300ms certloop is paid ONCE for N fetches. Touches nothing existing. If GREEN, the next step is a connection-pool layer in the research engine (also isolated). license_tier: ORIGINAL expect_exit: 0

dependencies 13 imports · 0 importers

nx_syscalls.nx nx_tls13.nx nx_tls13_record.nx nx_tls13_read_record_from_fd.nx nx_tls13_client_session.nx nx_x509_trust_store.nx nx_trust_store_load_from_certdata. nx_tls13_client_validate_certifica nx_tls13_client_session_run.nx nx_url.nx nx_https_ka_probe.nx

diagram shows first 10 each side; +3 more imports, +0 more importers in the complete lists below.

imports: nx_syscalls.nxnx_tls13.nxnx_tls13_record.nxnx_tls13_read_record_from_fd.nxnx_tls13_client_session.nxnx_x509_trust_store.nxnx_trust_store_load_from_certdata.nxnx_tls13_client_validate_certificate.nxnx_tls13_client_session_run.nxnx_url.nxnx_https_url_for_fetch.nxnx_https_url_connect.nxnx_http_response_parse.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main kp sys_write nx_trust_store_load_from_c sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close nx_nss_certdata_parse sys_mmap ↻ _pat_class_cert _pat_value_octal _pat_end _find_newline _starts_with _parse_octal_line sys_mmap ↻ _is_space _decode_octal_escape _is_octal trust_store_alloc sys_mmap ↻ nx_x509_trust_store_load sys_mmap ↻ x509_parse sys_mmap ↻ asn1_cursor_init asn1_expect_tag sys_mmap ↻ asn1_read_tlv_header asn1_read_tag asn1_read_length asn1_read_length ↻ x509_read_tlv sys_mmap ↻ asn1_expect_tag ↻ x509_read_alg_id

structs

none

consts

20const K_MAGIC_4096: i64 = 4096
21const K_MAGIC_16645: i64 = 16645
22const K_MAGIC_4194304: i64 = 4194304

functions

24func kp(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: main calls 1: sys_write
25func kn(v: i64) -> i64 { let b: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0} let t: *u8=sys_mmap(28); 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 }
26func ka_write_n(fd: i64, buf: *u8, n: i64) -> i64 { var off: i64=0; while off<n { let w: i64=sys_write(fd,(buf as i64+off) as *u8,n-off); if w<=0 {return 0-1} off=off+w } return 0 }
called by 1: ka_get calls 1: sys_write
29func ka_cat(out: *u8, o: i64, s: *u8) -> i64 { var j: i64=0; while s[j]!=(0 as u8) { out[o]=s[j]; o=o+1; j=j+1 } return o }
called by 1: ka_build_req
30func ka_build_req(path: *u8, path_len: i64, host: *u8, host_len: i64, out: *u8) -> i64
called by 1: ka_get calls 1: ka_cat
41func ka_hdr_end(buf: *u8, n: i64) -> i64 { var i: i64=0; while i+4<=n { if buf[i]==(13 as u8){if buf[i+1]==(10 as u8){if buf[i+2]==(13 as u8){if buf[i+3]==(10 as u8){return i}}}} i=i+1 } return 0-1 }
called by 1: ka_get
42func ka_lc(c: i64) -> i64 { if c>=65 { if c<=90 { return c+32 } } return c }
called by 1: ka_clen
43func ka_clen(buf: *u8, hdr_end: i64) -> i64
called by 1: ka_get calls 1: ka_lc
69func ka_get(s: *Tls13ClientSession, fd: i64, path: *u8, path_len: i64, host: *u8, host_len: i64, out_buf: *u8, out_cap: i64) -> i64
116func main() -> i64