code wiki / (root) / nx_mock_web.nx

nx_mock_web.nx

buildroot/runtime/nx_mock_web.nx

4324 B85 linesdepth 4pulls 6 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_mock_web.nx -- a tiny loopback "web" for end-to-end crawl testing. Serves a few real HTML pages by path (including an adult-aggregator-style page) so we can prove the crawler finds uncensored content over real HTTP, in-sandbox, with no external network. Run alongside nx_crawl_run.

dependencies 2 imports · 0 importers

nx_str.nx nx_http_server.nx nx_mock_web.nx

imports: nx_str.nxnx_http_server.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main nx_http_server_addr_any nx_http_server_make_sockad nx_http_server_listen sys_ignore_sigpipe sys_mmap sys_socket sys_mmap ↻ sys_setsockopt sys_bind sys_close sys_listen nx_http_server_accept_one sys_accept nx_http_server_read_reques sys_read nx_http_parse_request bput nx_str_len bputc mw_contains nx_str_len ↻

structs

none

consts

7const NX_MAGIC_8192: i64 = 8192
8const NX_MAGIC_16384: i64 = 16384
10const NX_MOCK_PORT: i64 = 8088

functions

12func bputc(buf: *u8, pos: *i64, cap: i64, c: i64) -> i64 { if pos[0] < cap { buf[pos[0]] = c; pos[0] = pos[0] + 1 } return 0 }
called by 1: bput
13func bput(buf: *u8, pos: *i64, cap: i64, s: *u8) -> i64 { let n: i64 = nx_str_len(s); var i: i64 = 0; while i < n { bputc(buf, pos, cap, s[i] as i64); i = i + 1 } return 0 }
called by 1: main calls 2: nx_str_lenbputc
16func mw_contains(req: *u8, off: i64, len: i64, needle: *u8) -> i64
called by 1: main calls 1: nx_str_len
33func main() -> i64