code wiki / (root) / nx_urlcanon.nx

nx_urlcanon.nx

buildroot/runtime/nx_urlcanon.nx

3052 B79 linesdepth 4pulls 4 transitivereach 2 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_urlcanon.nx -- URL canonicalization for crawl de-duplication. module: nishi-core.search.urlcanon depends: nx_str.nx capability: CORE_COMPUTE wired_status: FULLY_WIRED WHY: the same resource is reachable under many URL spellings (host-case, #fragment, default :80/:443). Canonicalizing before the visited-set check means we DON'T re-fetch the same page under a cosmetic variant -- saving crawl budget and, crucially, not hammering hosts (-> not getting blacklisted). RFC 3986 syntax-based normalization (the safe subset): * lowercase scheme + host (case-insensitive per RFC 3986 sec 6.2.2.1) * drop the fragment (never sent to the origin server) * drop the default port (:80 for http, :443 for https) Path + query are preserved verbatim (case- and order-significant). Tracking- param stripping is a queued refinement.

dependencies 1 imports · 2 importers

nx_str.nx nx_urlcanon.nx nx_crawl_main.nx nx_urlcanon_test.nx

imports: nx_str.nx

imported by: nx_crawl_main.nxnx_urlcanon_test.nx

structs

none

consts

none

functions

21func _uc_lc(c: i64) -> i64 { if c >= 0x41 { if c <= 0x5A { return c + 0x20 } } return c }
called by 1: nx_url_canon
24func nx_url_canon(url: *u8, n: i64, out: *u8, cap: i64) -> i64
called by 2: _eqmain calls 1: _uc_lc