code wiki / _hdl_build / nx_tls13_app_send_fd.nx

nx_tls13_app_send_fd.nx

buildroot/runtime/_hdl_build/nx_tls13_app_send_fd.nx

3729 B83 linesdepth 12pulls 33 transitivereach 3 importersview sourcekind librarytopic tls13
docsdependenciesstructsconstsfunctions

about

nx_tls13_app_send_fd.nx -- chunked TLS 1.3 application-data send to an fd. ROOT CAUSE this fixes: nx_tls13_server_session_app_send encrypts the WHOLE payload as ONE record, but RFC 8446 ยง5.1 caps record plaintext at 2^14 (16384) bytes -- compliant clients MUST abort with record_overflow on anything bigger. The hosting path therefore could not serve any asset over ~16.3KB (the /video page is 19KB, its JS ~35KB). This module splits the payload into <=NX_TLS13_SENDFD_CHUNK-byte records and writes each to the fd, handling partial writes. One reusable record buffer, supplied by the caller (constant-memory daemons hoist it once). Composes nx_tls13_server_session_app_send (KAT'd record build) -- the per-record path is UNCHANGED, so existing small-response behaviour is byte-identical (API contract stability: additive, nothing renamed). Gate: nx_tls13_app_send_fd_gate.nx (fabricated CONNECTED session with fixed keys -> 40KB payload -> records to a file -> decrypt each record with nx_tls13_record_decrypt_v2 -> reassembled plaintext byte-compares). license_tier: ORIGINAL

dependencies 5 imports · 3 importers

nx_syscalls.nx nx_tls13.nx nx_tls13_record.nx nx_tls13_server_session.nx nx_tls13_server_session_app_data.n nx_tls13_app_send_fd.nx nx_cms_tls_front.nx nx_sites_daemon_v2.nx nx_tls13_app_send_fd_gate.nx

imports: nx_syscalls.nxnx_tls13.nxnx_tls13_record.nxnx_tls13_server_session.nxnx_tls13_server_session_app_data.nx

imported by: nx_cms_tls_front.nxnx_sites_daemon_v2.nxnx_tls13_app_send_fd_gate.nx

structs

none

consts

30const NX_TLS13_SENDFD_CHUNK: i64 = 16000
32const NX_TLS13_SENDFD_REC_MIN: i64 = 16384

functions

36func nx_tls13_sendfd_write_all(fd: i64, buf: *u8, n: i64) -> i64
50func nx_tls13_app_send_fd(