code wiki / (root) / nx_https_post_complete.nx

nx_https_post_complete.nx

buildroot/runtime/nx_https_post_complete.nx

6741 B184 linesdepth 11pulls 40 transitivereach 27 importersview sourcekind tooltopic https
docsdependenciesstructsconstsfunctions

about

nx_https_post_complete.nx -- HTTPS POST companion to nx_https_get_complete. Sends an HTTP/1.1 POST request with a caller-supplied body (typically application/jose+json for ACME) over a CONNECTED TLS 1.3 session, then drains the encrypted response into out_buf. Composes: nx_http_client_build_request_post -- POST line + headers + body nx_tls13_record_encrypt_v2 -- AEAD wrap (one request rec) nx_tls13_read_record_from_fd -- partial-read framer nx_tls13_record_decrypt_v2 -- AEAD unwrap per response rec Body size limit: NX_HTTPS_PC_BODY_BYTES (8 KB). ACME requests are typically <2 KB (JWS-wrapped JSON over a 32-byte EdDSA key) so 8 KB gives a comfortable margin. Caller should fragment larger payloads across multiple TLS records explicitly (not auto-fragment here -- callers needing >8 KB request bodies are sufficiently rare that they should opt in). Verdict mirrors NX_HTTPS_GC_* with a PC prefix; same sealed-enum shape (positive bytes on success, negative -verdict on failure). Per Cardinals 9 (single-responsibility -- ONE round trip), 22 (composition of shipped primitives), 25 (build intelligence, don't strip features -- adds POST capability without weakening GET). license_tier: INDEPENDENT_REDERIVE genealogy_id: international-research-sources/ietf/rfc_8446 + rfc_9112 + rfc_8555 lineage_id: nishi_https_post_complete_q1

dependencies 6 imports · 9 importers

nx_syscalls.nx nx_tls13.nx nx_tls13_record.nx nx_tls13_read_record_from_fd.nx nx_tls13_client_session.nx nx_http_client.nx nx_https_post_complete.nx nx_acme_http.nx nx_connect_live_verify.nx nx_crew_live_verify.nx nx_edge_probe.nx nx_funcheck.nx nx_https_post_complete_test.nx nx_office_live_verify.nx nx_porkbun_ping_probe.nx nx_survey_live_verify.nx

imports: nx_syscalls.nxnx_tls13.nxnx_tls13_record.nxnx_tls13_read_record_from_fd.nxnx_tls13_client_session.nxnx_http_client.nx

imported by: nx_acme_http.nxnx_connect_live_verify.nxnx_crew_live_verify.nxnx_edge_probe.nxnx_funcheck.nxnx_https_post_complete_test.nxnx_office_live_verify.nxnx_porkbun_ping_probe.nxnx_survey_live_verify.nx

structs

none

consts

38const NX_HTTPS_PC_OK: i64 = 1
39const NX_HTTPS_PC_BAD_STATE: i64 = 2
40const NX_HTTPS_PC_BUILD_FAIL: i64 = 3
41const NX_HTTPS_PC_ENCRYPT_FAIL: i64 = 4
42const NX_HTTPS_PC_WRITE_FAIL: i64 = 5
43const NX_HTTPS_PC_READ_FAIL: i64 = 6
44const NX_HTTPS_PC_DECRYPT_FAIL: i64 = 7
45const NX_HTTPS_PC_BUF_OVERFLOW: i64 = 8
46const NX_HTTPS_PC_BODY_TOO_BIG: i64 = 9
47const NX_HTTPS_PC_VERDICT_N: i64 = 10
49const NX_HTTPS_PC_REQ_BUF_BYTES: i64 = 16384 // header (~512) + body (<= 8 KB) + slack
50const NX_HTTPS_PC_BODY_BYTES: i64 = 8192
51const NX_HTTPS_PC_RESP_RECORD_BYTES: i64 = 16645

functions

53func nx_https_pc_verdict_is_valid(v: i64) -> i64
called by 1: main
59func _pc_write_n(fd: i64, buf: *u8, n: i64) -> i64
called by 1: nx_https_post_complete calls 1: sys_write
69func nx_https_post_complete(
182func main() -> i64