You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TASK-067: remove v1 registered_resources* maps and namespace compat shim
Three transitional v1 surfaces are gone, leaving the v2 3-tier route
table as the only registration / dispatch oracle:
1. webserver_impl::{registered_resources, registered_resources_str,
registered_resources_regex, registered_resources_mutex} — registration-
time bookkeeping replaced by direct writes to exact_routes_, the radix
tree (param_and_prefix_routes_), and regex_routes_. Duplicate detection
migrates from the v1 ordered map's .insert() oracle to a new
reject_duplicate_v2_entry_ helper that probes the correct v2 tier for
a pre-existing entry before any mutation — preserving the
"throw-leaves-table-prior-state" atomicity contract pinned by
basic_suite::duplicate_endpoints.
2. namespace httpserver::compat (auth_handler_v1_ptr +
adapt_legacy_auth), the [[deprecated]] create_webserver::auth_handler
overload accepting it, and the paired push/pop
-Wdeprecated-declarations suppression at the forwarding call site —
all removed. The auth_handler_legacy_shim_test TU goes away; a new
no_v1_compat_shim_test TU pins the post-removal sentinel via a
std::void_t SFINAE detection idiom (negative compile-time check that
the v1 shared_ptr-returning shape is no longer accepted).
3. Readers of the v1 maps — prepare_or_create_lambda_shim's conflict
detection, the resolve_single_resource_ short-circuit in dispatch,
and the WebSocket-path's use of registered_resources_mutex to guard
registered_ws_handlers — all rewired. WebSocket registration/dispatch
now uses a dedicated ws_handlers_mutex_ instead of piggy-backing on
the deleted v1 mutex. The single_resource fast path is folded into
lookup_v2 (a single registered prefix terminus at "/" surfaces as a
trivial radix descent).
TASK-070 (the partner -Wdeprecated-declarations suppression in
http_resource.cpp:81-115 that the action-items list points to) is
explicitly handed off — its own M-sized scope (atomic shared_ptr
migration) would balloon this PR.
Drive-by fixes surfaced by the fresh integ-test rebuild this commit
forces:
- test/integ/basic.cpp:155,367 — wrap two legacy
with_cookie(string,string) call sites in -Wdeprecated-declarations
push/pop. Pre-existing TASK-064 deprecation that incremental builds
silently skipped (basic.o was stale from before TASK-064).
- test/integ/basic.cpp:498 — duplicate_endpoints's "ok" vs "OK"
case-folding assertion was pinning a v1 quirk (registered_resources
used http_endpoint::operator<, unconditionally case-insensitive via
std::toupper regardless of CASE_INSENSITIVE). The v2 route table is
consistently case-sensitive without -DCASE_INSENSITIVE, so the
assertion is now CASE_INSENSITIVE-gated to match dispatch-time
lookup semantics.
Acceptance criteria (all satisfied):
- grep -nE 'registered_resources' src/httpserver/detail/webserver_impl.hpp
returns no matches.
- grep -nE 'namespace compat' src/httpserver/create_webserver.hpp returns
no matches.
- grep -nE 'Wdeprecated-declarations' src/httpserver/create_webserver.hpp
returns no matches.
- make -j1 check passes 95/95 tests.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
**Implementation status:** TASK-025 introduced `detail::route_entry` and the `lambda_resource` shim into the existing v1 three-map storage shape. TASK-027 wired `route_entry` into the full 3-tier table described above (hash map for exact paths, radix tree for parameterized/prefix paths, regex chain for regex routes). TASK-053 retired the v1 dispatch path: `webserver_impl::resolve_resource_for_request` now consults `lookup_v2()` (cache → exact → radix → regex) directly, the v1 LRU cache and the four v1 lookup helpers (`lookup_route_cache`, `scan_regex_routes`, `store_route_cache`, `apply_extracted_params`) are deleted, and the LRU cache field is renamed `route_lru_cache`. The v1 registration-side maps (`registered_resources`, `registered_resources_str`, `registered_resources_regex`) survive *only* as registration-time bookkeeping for `prepare_or_create_lambda_shim` (lambda/class conflict detection) and the WebSocket dispatch path, both of which are non-HTTP-dispatch concerns; their removal is its own follow-up task. TASK-056 swapped the radix-node child container from `std::unordered_map` to `std::map<…, std::less<>>` for CWE-407 immunity and added registration-time detection of prefix-vs-exact terminus collisions (`reject_terminus_collision`).
30
+
**Implementation status:** TASK-025 introduced `detail::route_entry` and the `lambda_resource` shim into the existing v1 three-map storage shape. TASK-027 wired `route_entry` into the full 3-tier table described above (hash map for exact paths, radix tree for parameterized/prefix paths, regex chain for regex routes). TASK-053 retired the v1 dispatch path: `webserver_impl::resolve_resource_for_request` now consults `lookup_v2()` (cache → exact → radix → regex) directly, the v1 LRU cache and the four v1 lookup helpers (`lookup_route_cache`, `scan_regex_routes`, `store_route_cache`, `apply_extracted_params`) are deleted, and the LRU cache field is renamed `route_lru_cache`. **TASK-067** deleted the v1 registration-side maps (`registered_resources`, `registered_resources_str`, `registered_resources_regex`) and their shared mutex; the v2 3-tier table is now the only routing surface end-to-end. Lambda/class path-conflict detection (`prepare_or_create_lambda_shim`) probes the v2 tiers via `find_v2_entry_by_path_`; the WebSocket registration map keeps its own `registered_ws_handlers_mutex_`. TASK-056 swapped the radix-node child container from `std::unordered_map` to `std::map<…, std::less<>>` for CWE-407 immunity and added registration-time detection of prefix-vs-exact terminus collisions (`reject_terminus_collision`).
0 commit comments