Skip to content

Commit 806d03f

Browse files
etrclaude
andcommitted
TASK-086: prune includes + remove orphan comment in webserver_response_queue, check action items
Validation fixes: pruned webserver_response_queue.cpp from ~60 inherited includes to the 10 actually used (349 -> 274 LOC), removed 8 unused using-declarations and a stranded comment block; checked off the six completed action items in the task file. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015bNfjNMbo9J5WvrcA4ZQqY
1 parent 03c15df commit 806d03f

2 files changed

Lines changed: 7 additions & 82 deletions

File tree

specs/tasks/M7-v2-cleanup/TASK-086.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ block at lines 26-46 and is the single residual TEMP-BUMP from commit
1111
`87185ea`. Execute the four splits and drop the ceiling.
1212

1313
**Action Items:**
14-
- [ ] `src/httpserver/create_webserver.hpp` (712 LOC) → ~400 + ~300. Likely split: builder-state struct + setter definitions into a new private `create_webserver_setters.hpp` with public surface unchanged.
15-
- [ ] `src/hook_handle.cpp` (572 LOC) → ~430. Likely split: factor the per-phase dispatch helpers into `detail/hook_handle_dispatch.cpp`.
16-
- [ ] `src/detail/webserver_routes.cpp` (547 LOC) → ~480. Likely split: extract the regex tier or the LRU helpers into a sibling TU.
17-
- [ ] `src/httpserver/http_request.hpp` (583 LOC) → ~400 + ~250. Likely split: container-getter declarations vs. single-key getters, or move the inline `iovec_entry`-related members into a paired `http_request_iovec.hpp` already exists from TASK-004.
18-
- [ ] Drop the `FILE_LOC_MAX` default from 750 to 500. Remove the TEMP-BUMP comment block at lines 26-46.
19-
- [ ] Verify `make check` is green and `verify-build.yml` lint lanes pass.
14+
- [x] `src/httpserver/create_webserver.hpp` (712 LOC) → ~400 + ~300. Likely split: builder-state struct + setter definitions into a new private `create_webserver_setters.hpp` with public surface unchanged.
15+
- [x] `src/hook_handle.cpp` (572 LOC) → ~430. Likely split: factor the per-phase dispatch helpers into `detail/hook_handle_dispatch.cpp`.
16+
- [x] `src/detail/webserver_routes.cpp` (547 LOC) → ~480. Likely split: extract the regex tier or the LRU helpers into a sibling TU.
17+
- [x] `src/httpserver/http_request.hpp` (583 LOC) → ~400 + ~250. Likely split: container-getter declarations vs. single-key getters, or move the inline `iovec_entry`-related members into a paired `http_request_iovec.hpp` already exists from TASK-004.
18+
- [x] Drop the `FILE_LOC_MAX` default from 750 to 500. Remove the TEMP-BUMP comment block at lines 26-46.
19+
- [x] Verify `make check` is green and `verify-build.yml` lint lanes pass.
2020

2121
**Dependencies:**
2222
- Blocked by: None

src/detail/webserver_response_queue.cpp

Lines changed: 1 addition & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -21,79 +21,19 @@
2121
#include "httpserver/webserver.hpp"
2222
#include "httpserver/detail/webserver_impl.hpp"
2323

24-
#if defined(_WIN32) && !defined(__CYGWIN__)
25-
#include <winsock2.h>
26-
#include <ws2tcpip.h>
27-
#define _WINDOWS
28-
#else
29-
#if defined(__CYGWIN__)
30-
#include <sys/select.h>
31-
#endif
32-
#include <netinet/in.h>
33-
#include <netinet/tcp.h>
34-
#endif
35-
36-
#include <errno.h>
3724
#include <microhttpd.h>
38-
#ifdef HAVE_WEBSOCKET
39-
#include <microhttpd_ws.h>
40-
#endif // HAVE_WEBSOCKET
41-
#include <signal.h>
42-
#include <stdint.h>
43-
#include <stdio.h>
44-
#include <stdlib.h>
45-
#include <strings.h>
46-
#include <algorithm>
47-
#include <chrono>
48-
#include <cstring>
49-
#include <iosfwd>
50-
#include <iostream>
51-
#include <memory>
52-
#include <mutex>
5325
#include <optional>
54-
#include <regex>
55-
#include <set>
56-
#include <shared_mutex>
5726
#include <stdexcept>
5827
#include <string>
59-
#include <string_view>
6028
#include <utility>
61-
#include <vector>
6229

63-
#include "httpserver/constants.hpp"
64-
#include "httpserver/create_webserver.hpp"
65-
#include "httpserver/feature_unavailable.hpp"
66-
#include "httpserver/websocket_handler.hpp"
67-
#include "httpserver/detail/http_endpoint.hpp"
68-
#include "httpserver/detail/lambda_resource.hpp"
30+
#include "httpserver/detail/body.hpp"
6931
#include "httpserver/detail/modded_request.hpp"
70-
#include "httpserver/detail/path_normalize.hpp"
71-
#include "httpserver/detail/resource_hook_table.hpp"
72-
#include "httpserver/http_request.hpp"
73-
#include "httpserver/http_resource.hpp"
7432
#include "httpserver/http_response.hpp"
7533
#include "httpserver/http_utils.hpp"
76-
#include "httpserver/string_utilities.hpp"
77-
#include "httpserver/detail/body.hpp"
78-
79-
#ifdef HAVE_GNUTLS
80-
#include <gnutls/gnutls.h>
81-
#include <gnutls/x509.h>
82-
#endif // HAVE_GNUTLS
83-
84-
using std::string;
85-
using std::pair;
86-
using std::vector;
87-
using std::map;
88-
using std::set;
8934

9035
namespace httpserver {
9136

92-
using httpserver::http::http_utils;
93-
using httpserver::http::ip_representation;
94-
using httpserver::http::base_unescaper;
95-
96-
9737
namespace detail {
9838

9939
// webserver_response_queue.cpp -- response materialization and queueing.
@@ -329,21 +269,6 @@ MHD_Result webserver_impl::materialize_and_queue_response(MHD_Connection* connec
329269
return (MHD_Result) to_ret;
330270
}
331271

332-
// TASK-048: gated fire of the route_resolved phase. Built as a small
333-
// helper so finalize_answer stays under the per-function CCN ceiling
334-
// (CCN_MAX in scripts/check-complexity.sh) after the addition of the
335-
// hook firing site. Observation-only per DR-012 §4.10.
336-
//
337-
// LIFETIME NOTE: desc.path_template is a string_view into
338-
// mr->matched_path_template (a per-request std::string on modded_request).
339-
// The view is only valid for the duration of fire_route_resolved — hooks
340-
// must not capture it past their return. See route_descriptor::path_template
341-
// Doxygen in hook_context.hpp for the full contract.
342-
//
343-
// hrm may be null for lambda-route hits; the 'found && hrm' gate covers
344-
// both the miss path (found==false) and the lambda-route hit (found==true
345-
// but no http_resource*), both of which produce desc==nullopt.
346-
347272
} // namespace detail
348273

349274
} // namespace httpserver

0 commit comments

Comments
 (0)