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
- Mark TASK-013 status as Done (matches the convention used by all other
M2 tasks; addresses housekeeper-iter1-16) and tick off the six action
items now satisfied by the implementation commit.
- Sync specs/tasks/_index.md row from "Not Started" → "Done".
- Sync specs/architecture/04-components/http-response.md to reflect the
sealed `final` http_response and the ref-qualified `& / &&` `with_*`
setter overloads added in TASK-009/TASK-012.
- Record the 33 unworked findings (1 major, 32 minor) from the validation
pass in specs/unworked_review_issues/2026-05-04_013108_task-013.md.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: specs/architecture/04-components/http-response.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
**Responsibility:** Describe the response a handler wants to send: status, headers, footers, cookies, body. Constructed by user code via factories; consumed by library dispatch which materializes an `MHD_Response*` from it.
4
4
5
-
**Implementation:****Non-PIMPL value type.** Public header carries the data members directly:
5
+
**Implementation:****Non-PIMPL value type, declared `final` (sealed per PRD §3.5).** Inheritance is prevented at compile time; `static_assert(std::is_final_v<httpserver::http_response>)` is exercised in the SBO unit test. Public header carries the data members directly:
6
6
-`int status_code`
7
7
-`http::header_map headers`, `footers`, `cookies` (separate maps; cookies kept distinct from headers for v2.0 API compatibility)
@@ -21,7 +21,7 @@ The body subclasses (`detail::string_body`, `file_body`, `iovec_body`, `pipe_bod
21
21
- Exposes (from PRD §3.5):
22
22
- Factories: `http_response::string(...)`, `::file(...)`, `::iovec(std::span<const httpserver::iovec_entry>)`, `::pipe(...)`, `::empty(...)`, `::deferred(...)`, `::unauthorized(scheme, realm, ...)` — all return `http_response` by value.
23
23
- **`httpserver::iovec_entry`** is a library-defined POD declared in `<httpserver/http_response.hpp>`: `struct iovec_entry { const void* base; std::size_t len; };`. It mirrors POSIX `struct iovec` exactly in layout but does not require `<sys/uio.h>` in any installed header. The internal dispatch path uses the user-supplied span to build a `struct iovec` array inside `iovec_body`. The implementation file (`detail/body.hpp` / `http_response.cpp`) carries `static_assert`s pinning the layout assumption: `static_assert(sizeof(iovec_entry) == sizeof(struct iovec))`, `static_assert(offsetof(iovec_entry, base) == offsetof(struct iovec, iov_base))`, `static_assert(offsetof(iovec_entry, len) == offsetof(struct iovec, iov_len))`. When the asserts hold, conversion is a `reinterpret_cast`; when they fail (a hypothetical platform with divergent layout), the build fails loudly at compile time and we fall back to memcpy. This keeps the public header free of system headers and makes the API uniformly available on platforms where `<sys/uio.h>` is not standard (e.g., MSVC builds).
- Fluent setters: `with_header`, `with_footer`, `with_cookie`, `with_status` — each has two ref-qualified overloads: `& → http_response&` (mutate-in-place on an lvalue) and `&& → http_response&&` (return the object by rvalue-reference for zero-copy rvalue factory chains, e.g. `http_response::string("body").with_header("X-Foo", "bar").with_status(201)`).
25
25
-`const` accessors: `get_header`, `get_footer`, `get_cookie` returning `string_view` (empty on miss; do not insert).
Copy file name to clipboardExpand all lines: specs/tasks/M2-response/TASK-013.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,12 +8,12 @@
8
8
Delete the public-facing response subclasses and the `get_raw_response`/`decorate_response`/`enqueue_response` virtuals so the new factory-based surface is the only way to build a response.
9
9
10
10
**Action Items:**
11
-
-[] Remove `src/httpserver/string_response.hpp`, `file_response.hpp`, `iovec_response.hpp`, `pipe_response.hpp`, `deferred_response.hpp`, `empty_response.hpp`, `basic_auth_fail_response.hpp`, `digest_auth_fail_response.hpp` from the installed set.
12
-
-[] Delete those classes' source files (or move any salvageable logic into `detail/body.hpp`).
13
-
-[] Remove the public virtual methods `get_raw_response`, `decorate_response`, `enqueue_response` from `http_response.hpp`.
14
-
-[] Update `<httpserver.hpp>` umbrella to drop the removed includes.
15
-
-[] Internal dispatch path (in `webserver.cpp` or `http_response.cpp`) calls `body_->materialize(...)` instead of the removed virtuals.
16
-
-[] Add `final` to `http_response` (deferred from TASK-009 because the v1 subclasses still inherited at that point — see TASK-009 plan OQ-1). Per PRD §3.5 the class must be sealed.
11
+
-[x] Remove `src/httpserver/string_response.hpp`, `file_response.hpp`, `iovec_response.hpp`, `pipe_response.hpp`, `deferred_response.hpp`, `empty_response.hpp`, `basic_auth_fail_response.hpp`, `digest_auth_fail_response.hpp` from the installed set.
12
+
-[x] Delete those classes' source files (or move any salvageable logic into `detail/body.hpp`).
13
+
-[x] Remove the public virtual methods `get_raw_response`, `decorate_response`, `enqueue_response` from `http_response.hpp`.
14
+
-[x] Update `<httpserver.hpp>` umbrella to drop the removed includes.
15
+
-[x] Internal dispatch path (in `webserver.cpp` or `http_response.cpp`) calls `body_->materialize(...)` instead of the removed virtuals.
16
+
-[x] Add `final` to `http_response` (deferred from TASK-009 because the v1 subclasses still inherited at that point — see TASK-009 plan OQ-1). Per PRD §3.5 the class must be sealed.
0 commit comments