code wiki / (root) / nx_http_response_complete_candidate_t314.nx

nx_http_response_complete_candidate_t314.nx

buildroot/runtime/nx_http_response_complete_candidate_t314.nx

22950 B570 linesdepth 2pulls 2 transitivereach 2 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 · 1 importers

nx_syscalls.nx nx_http_response_complete_cand nx_tool_http_backend_candidate_t31

imports: nx_syscalls.nx

imported by: nx_tool_http_backend_candidate_t314.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
492const NX_HTTP_RESP_ERR_FRAMING: i64 = 9
493const NX_HTTP_RESP_ERR_ENCODING: i64 = 10
494const NX_HTTP_RESP_ERR_RESOURCE: i64 = 11

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
203func nx_http_resp_status_code(src:*u8,src_len:i64)->i64
223func nx_http_resp_parse_status_line(src:*u8,src_len:i64,out_code:*i64,out_reason_off:*i64,out_reason_len:*i64,out_next:*i64)->i64
237func nx_http_resp_parse_header_line(
297func nx_http_resp_alloc() -> *i64 { return sys_mmap(128) as *i64 }
calls 1: sys_mmap
301func nx_http_resp_classify_body(src: *u8, src_len: i64, r: *i64) -> i64
351func nx_http_response_parse(src: *u8, src_len: i64, r: *i64) -> i64
389func nx_http_response_header(
427func nx_http_dechunk_consumed(src: *u8, src_len: i64, out: *u8, out_cap: i64, consumed: *i64) -> i64
495func nx_http_dechunk(src:*u8,n:i64,out:*u8,cap:i64)->i64
499func nx_http_response_complete(src:*u8,n:i64,out:*u8,cap:i64,code:*i64,bodylen:*i64)->i64