nx_http_get_ua.nx
buildroot/runtime/nx_http_get_ua.nx
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
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
| 19 | func _hua_lit(out: *u8, o: i64, s: *u8) -> i64 |
| 25 | func _hua_buf(out: *u8, o: i64, b: *u8, n: i64) -> i64 called by 1: nx_http_ua_build_request |
| 33 | func nx_http_ua_build_request(path: *u8, plen: i64, host: *u8, hlen: i64, |
| 49 | func nx_http_get_ua(addr_packed: *u8, path: *u8, plen: i64, host: *u8, hlen: i64, |