Commit e9175c1
committed
TASK-015: http_request_impl skeleton (PIMPL split, structural only)
Move every backend-coupled member of http_request behind a
unique_ptr<detail::http_request_impl>. The public header
src/httpserver/http_request.hpp no longer includes <microhttpd.h>
or <gnutls/gnutls.h>; the only backend-typed names that remain
visible at the public surface are forward-declared (MHD_Connection*
in the HTTPSERVER_COMPILATION-gated private ctor, and a narrow
typedef forward-decl of gnutls_session_t for the still-public
get_tls_session() return type that TASK-019 will remove).
Outer keeps: path, method, content, version, content_size_limit,
plus the impl_ unique_ptr. Everything else (the live MHD_Connection*,
unescaper, file table, parsed-args / cookies / cert caches, the
MHD trampolines build_request_*, fetch_user_pass(),
populate_all_cert_fields()) lives on http_request_impl. Public
methods are one-line forwarders.
The dtor is out-of-line in http_request.cpp so unique_ptr<impl>
sees the complete impl type. Move ctor/assign remain defaulted
and operate on the unique_ptr.
A new sentinel test/unit/http_request_pimpl_test.cpp asserts that
http_request appears non-copy/non-move-constructible from external
scope (private moves), and locks sizeof(http_request) at <= 24
pointer widths. Currently 14 pointers (112 B on LP64).
Acceptance criteria all green:
- grep -E '#include <(microhttpd|gnutls/gnutls)\.h>' on the public
header returns nothing.
- All v1 request-side tests pass (basic, file_upload,
authentication, http_resource, threaded, nodelay, ws_start_stop,
uri_log, etc. -- 27 PASS + 1 XFAIL header_hygiene umbrella,
unchanged from baseline; the umbrella sweep is TASK-020).
- sizeof(http_request) = 14 * sizeof(void*); asserted in the new
sentinel.
- noinst_HEADERS lists the impl header so it ships in the source
tarball but never installs to $prefix/include.
- No test reaches across the boundary into http_request_impl.1 parent 369c2a8 commit e9175c1
8 files changed
Lines changed: 687 additions & 386 deletions
File tree
- specs/tasks
- M3-request
- src
- httpserver
- detail
- test
- unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
0 commit comments