nx_http_response_complete_candidate_t314.nx
buildroot/runtime/nx_http_response_complete_candidate_t314.nx
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
imports: nx_syscalls.nx
imported by: nx_tool_http_backend_candidate_t314.nx
structs
| none |
consts
| 35 | const NX_HTTP_RESP_OK: i64 = 0 |
| 36 | const NX_HTTP_RESP_ERR_TOO_SHORT: i64 = 1 |
| 37 | const NX_HTTP_RESP_ERR_BAD_STATUS_LINE: i64 = 2 |
| 38 | const NX_HTTP_RESP_ERR_BAD_VERSION: i64 = 3 |
| 39 | const NX_HTTP_RESP_ERR_BAD_CODE: i64 = 4 |
| 40 | const NX_HTTP_RESP_ERR_NO_BODY_SEP: i64 = 5 |
| 41 | const NX_HTTP_RESP_ERR_HEADER_OVERFLOW: i64 = 6 |
| 42 | const NX_HTTP_RESP_ERR_BAD_CHUNK_SIZE: i64 = 7 |
| 43 | const NX_HTTP_RESP_ERR_TRUNCATED: i64 = 8 |
| 45 | const NX_HTTP_BODY_EMPTY: i64 = 0 |
| 46 | const NX_HTTP_BODY_CONTENT_LENGTH: i64 = 1 |
| 47 | const NX_HTTP_BODY_CHUNKED: i64 = 2 |
| 48 | const NX_HTTP_BODY_UNTIL_CLOSE: i64 = 3 |
| 492 | const NX_HTTP_RESP_ERR_FRAMING: i64 = 9 |
| 493 | const NX_HTTP_RESP_ERR_ENCODING: i64 = 10 |
| 494 | const NX_HTTP_RESP_ERR_RESOURCE: i64 = 11 |
functions
| 58 | func nx_http_resp_is_digit(c: i64) -> i64 |
| 63 | func nx_http_resp_is_hex(c: i64) -> i64 calls 1: nx_http_resp_is_digit |
| 71 | func nx_http_resp_lower(c: i64) -> i64 called by 1: nx_http_resp_cieq |
| 77 | func nx_http_resp_hex_val(c: i64) -> i64 |
| 85 | func nx_http_resp_cieq(a: *u8, a_len: i64, b: *u8, b_len: i64) -> i64 called by 3: nx_http_resp_classify_bodynx_http_response_headernx_http_response_complete calls 1: nx_http_resp_lower |
| 99 | func nx_http_resp_find_byte(src: *u8, src_len: i64, off: i64, c: i64) -> i64 called by 1: nx_http_resp_parse_header_line |
| 109 | func nx_http_resp_find_crlf(src: *u8, src_len: i64, off: i64) -> i64 |
| 121 | func nx_http_resp_find_crlfcrlf(src: *u8, src_len: i64, off: i64) -> i64 |
| 139 | func nx_http_resp_parse_dec(src: *u8, src_len: i64, off: i64, out_end: *i64) -> i64 |
| 161 | func nx_http_resp_parse_hex(src: *u8, src_len: i64, off: i64, out_end: *i64) -> i64 calls 1: nx_http_resp_hex_val |
| 183 | func nx_http_resp_skip_ows(src: *u8, src_len: i64, off: i64) -> i64 called by 1: nx_http_resp_parse_header_line |
| 203 | func nx_http_resp_status_code(src:*u8,src_len:i64)->i64 |
| 223 | func 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 |
| 237 | func nx_http_resp_parse_header_line( |
| 297 | func nx_http_resp_alloc() -> *i64 { return sys_mmap(128) as *i64 } calls 1: sys_mmap |
| 301 | func nx_http_resp_classify_body(src: *u8, src_len: i64, r: *i64) -> i64 |
| 351 | func nx_http_response_parse(src: *u8, src_len: i64, r: *i64) -> i64 |
| 389 | func nx_http_response_header( |
| 427 | func nx_http_dechunk_consumed(src: *u8, src_len: i64, out: *u8, out_cap: i64, consumed: *i64) -> i64 called by 2: nx_http_dechunknx_http_response_complete calls 2: nx_http_resp_hex_valnx_http_resp_find_crlf |
| 495 | func nx_http_dechunk(src:*u8,n:i64,out:*u8,cap:i64)->i64 calls 1: nx_http_dechunk_consumed |
| 499 | func nx_http_response_complete(src:*u8,n:i64,out:*u8,cap:i64,code:*i64,bodylen:*i64)->i64 |