code wiki / (root) / nx_http_get_ua.nx

nx_http_get_ua.nx

buildroot/runtime/nx_http_get_ua.nx

2962 B68 linesdepth 5pulls 6 transitivereach 7 importersview sourcekind librarytopic http
docsdependenciesstructsconstsfunctions

about

nx_http_get_ua.nx -- reusable HTTP/1.1 GET with a User-Agent (bits-up). module: nishi-core.net.http_get_ua depends: nx_str.nx, nx_syscalls.nx capability: CORE_IO wired_status: FULLY_WIRED The plain-TCP GET-with-identifying-UA the crawlers all needed (was duplicated in nx_crawl_polite + nx_crawl_main). Extracted to ONE reusable primitive (DRY, Rule #15): socket -> connect -> build "GET ... + Host + User-Agent + Connection: close" -> drain -> parse status. Any HTTP client reuses it (crawler, torrent HTTP-tracker fallback, health probes). The request builder is pure (KAT'd); the fetch adds the socket round-trip.

dependencies 3 imports · 5 importers

nx_str.nx nx_connect.nx nx_syscalls.nx nx_http_get_ua.nx nx_browser.nx nx_crawl_main.nx nx_crawl_polite.nx nx_galx_seek_test.nx nx_http_get_ua_test.nx

imports: nx_str.nxnx_connect.nxnx_syscalls.nx

imported by: nx_browser.nxnx_crawl_main.nxnx_crawl_polite.nxnx_galx_seek_test.nxnx_http_get_ua_test.nx

structs

none

consts

none

functions

19func _hua_lit(out: *u8, o: i64, s: *u8) -> i64
called by 1: nx_http_ua_build_request calls 1: nx_str_len
25func _hua_buf(out: *u8, o: i64, b: *u8, n: i64) -> i64
33func nx_http_ua_build_request(path: *u8, plen: i64, host: *u8, hlen: i64,
called by 2: nx_http_get_uamain calls 2: _hua_lit_hua_buf
49func nx_http_get_ua(addr_packed: *u8, path: *u8, plen: i64, host: *u8, hlen: i64,