Commit 7b790e9
TASK-063: drop accepted-but-ignored size_hint from http_response::pipe
Removes the publicly exposed `size_hint` parameter from
`http_response::pipe(int fd, std::size_t = 0)`. The parameter was
reserved-for-future-use boilerplate — the dispatch path discarded it
(`(void)size_hint;`) and a unit test pinned that "accepted-but-ignored"
shape as the contract. An accepted-but-ignored API arg teaches callers
a lie, and the M7 v2-cleanup milestone is the cutover to fix it.
Why not honor it instead:
- No PRD-RSP-REQ-* requires it (PRD §3.5 lists the v2 response
factories and `pipe` carries no second arg).
- libmicrohttpd's `MHD_create_response_from_pipe` takes no size.
- Synthesising a `Content-Length` from a hint would lie when the
pipe yields a different byte count.
- See `.groundwork-plans/TASK-063-plan.md` for the full rationale.
What changes:
- `src/httpserver/http_response.hpp`: drop the `size_hint` parameter and
its doc paragraph from the `pipe` declaration.
- `src/http_response.cpp`: drop the parameter from the definition and
the `(void)size_hint;` suppressor.
- `test/unit/http_response_factories_test.cpp`: replace the
`pipe_factory_size_hint_is_accepted_but_ignored` runtime pin with a
`static_assert` on `decltype(&http_response::pipe) ==
http_response (*)(int)`. Any future re-introduction of a second
parameter fails to compile with a TASK-063 message.
- `RELEASE_NOTES.md`: bullet under `## What changed semantically`
documenting the signature change. SOVERSION already bumps for v2.0,
no further ABI bump needed.
Existing callers (examples/pipe_response_example.cpp,
test/integ/new_response_types.cpp, test/unit/http_response_factories_test.cpp)
already pass only the `fd`; no call-site edits required.
Verification:
- `http_response_factories`: 28 tests / 56 checks PASS (in isolation).
- `body`: 17/17 PASS (in isolation).
- `new_response_types` integ test (which exercises the pipe path):
3/3 PASS in isolation. The batch `make check` failures are a
pre-existing port-collision issue on this host, unchanged by this
patch.
- `check-readme.sh` / `check-release-notes.sh` / `check-examples.sh`:
all OK after RELEASE_NOTES edit.
- `cpplint` on changed files: clean.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent d97a421 commit 7b790e9
6 files changed
Lines changed: 29 additions & 25 deletions
File tree
- specs/tasks/M7-v2-cleanup
- src
- httpserver
- test/unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
225 | 234 | | |
226 | 235 | | |
227 | 236 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | | - | |
14 | | - | |
| 13 | + | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
405 | 405 | | |
406 | 406 | | |
407 | 407 | | |
408 | | - | |
409 | | - | |
| 408 | + | |
410 | 409 | | |
411 | 410 | | |
412 | 411 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
| 195 | + | |
200 | 196 | | |
201 | 197 | | |
202 | 198 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
253 | 259 | | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
| |||
0 commit comments