Skip to content

Commit 06ad399

Browse files
etrclaude
andcommitted
TASK-061: mechanical cleanup sweep — unfinished prose, orphan comments, stale doc references
- src/detail/webserver_register.cpp: complete the truncated TASK-029 block comment with the missing closing clause ("they are no longer reachable from the public API."). - src/detail/webserver_register.cpp: install the full TASK-024 prologue (six lines, ending "dangling resource pointer after the maps drop their refs.") immediately above webserver::unregister_impl_, the function the comment actually describes. - src/detail/webserver_setup.cpp: remove the orphaned five-line TASK-024 head that was sitting above the unrelated block_ip (split-artifact from the 7-way webserver.cpp split). - src/webserver.cpp:503-504: remove the two orphan comment fragments left after removed logic ("dangling resource pointer..." and "they are no longer reachable...") — both lines now have a single canonical home in webserver_register.cpp after the steps above. - test/Makefile.am:73-74: replace the stale "Currently in XFAIL_TESTS" claim with a status-correct "Now an unconditional PASS" note that cross-references the existing TASK-020 block at lines 533-536. - scripts/check-readme.sh:273: drop the stale "RELEASE_NOTES.md) continue ;; # created by TASK-042, not yet present" case arm — TASK-042 shipped, the file now exists, and the generic existence check at the bottom of the loop handles it. - test/littletest.hpp: left untouched per planning decision (vendored upstream liblittletest header, no fork policy authorising in-place edits to stylistic comments). Verification: - make check: 87/87 PASS, 0 FAIL. - check-file-size: PASS (FILE_LOC_MAX=750). - check-readme.sh: returns 0 end-to-end. - All five pre-edit failing grep guards now report zero matches. - Each of the three reflowed sentence fragments has exactly one canonical copy under src/. Pre-existing on feature/v2.0 (NOT introduced by this task): the check-doxygen.sh gate fails with seven warnings against unrelated headers (create_webserver.hpp, hook_context.hpp, webserver_websocket.hpp — none of which TASK-061 touches). Confirmed by running check-doxygen against an unchanged feature/v2.0 checkout and reproducing the same output. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent d272e78 commit 06ad399

5 files changed

Lines changed: 10 additions & 15 deletions

File tree

scripts/check-readme.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,6 @@ while IFS= read -r target; do
270270
case "$target" in
271271
http://*|https://*) continue ;; # absolute URLs — not checked
272272
\#*) continue ;; # in-page anchors — not checked
273-
RELEASE_NOTES.md) continue ;; # created by TASK-042, not yet present
274273
esac
275274
# Strip fragment identifiers (#section) before existence check to avoid
276275
# false failures when a link like [foo](examples/foo.cpp#line) is added.

src/detail/webserver_register.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,12 @@ void webserver::register_resource(const std::string& resource,
244244
register_path(resource, std::move(res));
245245
}
246246

247+
// TASK-024: erase a single registration of the requested kind (family).
248+
// Each kind keeps a distinct http_endpoint key (the family flag is part
249+
// of the endpoint's identity), so we must build the key with the right
250+
// flag or the erase silently misses. Caches are invalidated under the
251+
// registered_resources lock to prevent any thread from reading a
252+
// dangling resource pointer after the maps drop their refs.
247253
void webserver::unregister_impl_(const string& resource, bool family) {
248254
detail::http_endpoint he(resource, family, true, regex_checking);
249255

@@ -346,5 +352,6 @@ void webserver::unregister_resource(const string& resource) {
346352
// collapsed to a single name pair operating on the deny list. The internal
347353
// allowances set and the allow-list branch in policy_callback remain in
348354
// place so default_policy(REJECT) keeps working at the daemon level, but
355+
// they are no longer reachable from the public API.
349356

350357
} // namespace httpserver

src/detail/webserver_setup.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -438,11 +438,6 @@ bool webserver::add_connection(int client_socket, const struct sockaddr* addr, u
438438
static_cast<socklen_t>(addrlen)) == MHD_YES;
439439
}
440440

441-
// TASK-024: erase a single registration of the requested kind (family).
442-
// Each kind keeps a distinct http_endpoint key (the family flag is part
443-
// of the endpoint's identity), so we must build the key with the right
444-
// flag or the erase silently misses. Caches are invalidated under the
445-
// registered_resources lock to prevent any thread from reading a
446441
void webserver::block_ip(std::string_view ip) {
447442
std::unique_lock bans_lock(impl_->bans_mutex);
448443
ip_representation t_ip{std::string{ip}};

src/webserver.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -499,11 +499,4 @@ hook_handle webserver::add_hook(hook_phase phase,
499499
impl_->hooks_connection_closed_, std::move(fn));
500500
}
501501

502-
503-
// dangling resource pointer after the maps drop their refs.
504-
// they are no longer reachable from the public API.
505-
506-
507-
508-
509502
} // namespace httpserver

test/Makefile.am

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,9 @@ header_hygiene_iovec_SOURCES = unit/header_hygiene_iovec_test.cpp
7070
# passed so <httpserver.hpp> resolves.
7171
# - LDADD is overridden to empty: this is a pure-compile assertion, the
7272
# `int main(){}` body has no library dependencies.
73-
# Currently in XFAIL_TESTS (see below); flips to PASS when M5 lands and
74-
# the umbrella is free of backend-header leakage.
73+
# Now an unconditional PASS: TASK-020 landed and the <httpserver.hpp>
74+
# umbrella is free of backend-header leakage. See lines ~532-535 below
75+
# for the historical XFAIL_TESTS note.
7576
header_hygiene_SOURCES = unit/header_hygiene_test.cpp
7677
header_hygiene_CPPFLAGS = -I$(top_srcdir)/src $(CPPFLAGS)
7778
header_hygiene_LDADD =

0 commit comments

Comments
 (0)