code wiki / (root) / nx_http_response_parse.nx

nx_http_response_parse.nx

buildroot/runtime/nx_http_response_parse.nx

17092 B469 linesdepth 2pulls 2 transitivereach 419 importersview sourcekind librarytopic http
docsdependenciesstructsconstsfunctions

about

nx_http_response_parse.nx -- client-side HTTP/1.1 response parser. Parses the bytes that come back over a TLS record stream into: - status_code (integer, e.g. 200) - reason_offset (byte offset of reason phrase in input) - reason_len - headers_offset (byte offset of first header line) - headers_len (bytes covering all headers, EXCLUDING the blank line terminator) - body_offset (byte offset of body start in input, after the CRLF CRLF boundary) - body_len (Content-Length value if present and decoded, else 0 -- callers can dechunk explicitly via nx_http_dechunk) - transfer_kind (NX_HTTP_BODY_CONTENT_LENGTH | NX_HTTP_BODY_ CHUNKED | NX_HTTP_BODY_UNTIL_CLOSE | NX_HTTP _BODY_EMPTY) Field accessors (case-insensitive header name match): nx_http_response_header(parsed, name, name_len, val_off, val_len) Chunked decoder (RFC 7230 ยง4.1): nx_http_dechunk(src, src_len, out, out_cap) -> decoded_len Built per F7 post-order DFS: callees defined before callers. Built per F6 size discipline: <12 lets per function. expect_exit: 0 license_tier: ORIGINAL

dependencies 1 imports · 64 importers

nx_syscalls.nx nx_http_response_parse.nx nishi.nx nx_acme_directory_live.nx nx_acme_directory_live_real_ca_tes nx_acme_http.nx nx_app_monitor.nx nx_aw_verify_gate.nx nx_browse.nx nx_browse_text.nx nx_browser.nx nx_browser_image_demo_test.nx

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

imports: nx_syscalls.nx

imported by: nishi.nxnx_acme_directory_live.nxnx_acme_directory_live_real_ca_test.nxnx_acme_http.nxnx_app_monitor.nxnx_aw_verify_gate.nxnx_browse.nxnx_browse_text.nxnx_browser.nxnx_browser_image_demo_test.nxnx_browser_local_test.nxnx_browser_own_site_live_test.nxnx_browser_page_demo_test.nxnx_cad_verify_gate.nxnx_chrome_fetch_probe.nxnx_connect_live_verify.nxnx_crew_live_verify.nxnx_dev_api_build_probe.nxnx_fetch_jellyfin_test.nxnx_gallery_auth_research_fetch.nxnx_hf_probe.nxnx_hls_live_probe.nxnx_http_head_probe.nxnx_http_response_parse_test.nxnx_https_fetch_follow.nxnx_https_get_live_google_test.nxnx_https_get_live_real_ca_test.nxnx_https_ka_probe.nxnx_hub_lib_verify_gate.nxnx_hub_verify_gate.nxnx_iot_fetch_probe.nxnx_iot_verify_gate.nxnx_lib_fetch.nxnx_library_fetch.nxnx_login_e2e_probe.nxnx_model_fetch.nxnx_night_fetch_test.nxnx_nishios_net_wire.nxnx_nist_verify_gate.nxnx_office_live_verify.nxnx_onsite_frontier_fetch.nxnx_onsite_research_fetch.nxnx_orch_verify_gate.nxnx_page_get_test.nxnx_porkbun_ping_probe.nxnx_research_fetch_wiki_test.nxnx_research_ka.nxnx_scilib_verify_gate.nxnx_sclass_ux_research_fetch.nxnx_semantic_research_fetch.nxnx_site_probe.nxnx_survey_live_verify.nxnx_tls12_porkbun_e2e_gate.nxnx_tls12_reconnect_stress_gate.nxnx_torrent_live_probe.nxnx_url_probe.nxnx_url_truth_gate.nxnx_uxf_fetch_avro.nxnx_uxf_fetch_protobuf.nxnx_web_crawl_breadth.nxnx_web_crawl_index.nxnx_webpub_fetch.nxnx_wpt_fetch.nxnx_zerodt_fetch.nx

structs

none

consts

35const NX_HTTP_RESP_OK: i64 = 0
36const NX_HTTP_RESP_ERR_TOO_SHORT: i64 = 1
37const NX_HTTP_RESP_ERR_BAD_STATUS_LINE: i64 = 2
38const NX_HTTP_RESP_ERR_BAD_VERSION: i64 = 3
39const NX_HTTP_RESP_ERR_BAD_CODE: i64 = 4
40const NX_HTTP_RESP_ERR_NO_BODY_SEP: i64 = 5
41const NX_HTTP_RESP_ERR_HEADER_OVERFLOW: i64 = 6
42const NX_HTTP_RESP_ERR_BAD_CHUNK_SIZE: i64 = 7
43const NX_HTTP_RESP_ERR_TRUNCATED: i64 = 8
45const NX_HTTP_BODY_EMPTY: i64 = 0
46const NX_HTTP_BODY_CONTENT_LENGTH: i64 = 1
47const NX_HTTP_BODY_CHUNKED: i64 = 2
48const NX_HTTP_BODY_UNTIL_CLOSE: i64 = 3

functions

58func nx_http_resp_is_digit(c: i64) -> i64
63func nx_http_resp_is_hex(c: i64) -> i64
71func nx_http_resp_lower(c: i64) -> i64
called by 1: nx_http_resp_cieq
77func nx_http_resp_hex_val(c: i64) -> i64
85func nx_http_resp_cieq(a: *u8, a_len: i64, b: *u8, b_len: i64) -> i64
99func nx_http_resp_find_byte(src: *u8, src_len: i64, off: i64, c: i64) -> i64
109func nx_http_resp_find_crlf(src: *u8, src_len: i64, off: i64) -> i64
121func nx_http_resp_find_crlfcrlf(src: *u8, src_len: i64, off: i64) -> i64
139func nx_http_resp_parse_dec(src: *u8, src_len: i64, off: i64, out_end: *i64) -> i64
161func nx_http_resp_parse_hex(src: *u8, src_len: i64, off: i64, out_end: *i64) -> i64
183func nx_http_resp_skip_ows(src: *u8, src_len: i64, off: i64) -> i64
201func nx_http_resp_parse_status_line(
244func nx_http_resp_parse_header_line(
304func nx_http_resp_alloc() -> *i64 { return sys_mmap(128) as *i64 }
308func nx_http_resp_classify_body(src: *u8, src_len: i64, r: *i64) -> i64
358func nx_http_response_parse(src: *u8, src_len: i64, r: *i64) -> i64
396func nx_http_response_header(
434func nx_http_dechunk(src: *u8, src_len: i64, out: *u8, out_cap: i64) -> i64