Commit 8464996
refactor: split webserver_impl.hpp (674 → 330)
Step 3 of the FILE_LOC_MAX ratchet. Two extractions:
connection_state -> httpserver/detail/connection_state.hpp
The per-MHD_Connection PMR arena anchor (initial_buffer_ +
monotonic_buffer_resource + reset_arena()). Self-contained,
no webserver_impl coupling. As a bonus, http_request.cpp can
eventually narrow its #include from webserver_impl.hpp down
to just connection_state.hpp, dropping a heavy header (which
transitively pulls microhttpd / pthread / gnutls / regex) off
http_request.cpp's compile-time footprint -- not done in this
commit to keep the diff focused on the LOC ratchet.
dispatch / start-helper / MHD-trampoline method declarations ->
httpserver/detail/webserver_impl_dispatch.hpp
The 280-line tail of method declarations on webserver_impl --
start-helper overloads (add_*_mhd_options, compose_*_flags),
dispatch chain (requests_answer_first/second_step, finalize_answer
+ its CCN-10 sub-helpers), route-lookup / route-cache helpers,
auth short-circuit, post-iterator helpers, MHD trampolines,
GnuTLS PSK/SNI callbacks. Same in-class-body #include pattern
introduced in TASK-step-2 for http_request_auth.hpp: the sibling
header carries declarations only and gates itself behind
SRC_HTTPSERVER_DETAIL_WEBSERVER_IMPL_HPP_INSIDE_CLASS_, which is
#define'd/#undef'd around the include inside class webserver_impl
body. Standalone inclusion produces a #error.
webserver_impl.hpp ends up at 330 LOC (data members + lifecycle
ctors + the in-class-body include for the dispatch surface).
Behaviourally inert -- no ABI change, no public surface change. The
order of declarations inside class webserver_impl is preserved
verbatim because the sibling is included at the original textual
location.
FILE_LOC_MAX stays at 2700 -- webserver.cpp (2673) still pins it.
Offender list down to four files.
Verification:
make check 51/51 PASS (includes hygiene,
install-layout, doxygen,
examples, readme, release-notes)
./scripts/check-file-size.sh PASS at FILE_LOC_MAX=2700
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 3d5474e commit 8464996
5 files changed
Lines changed: 457 additions & 358 deletions
File tree
- scripts
- src
- httpserver/detail
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | 37 | | |
39 | 38 | | |
40 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
0 commit comments