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
{{ message }}
Repository navigation
Commit 7631185
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/v2-to-v3-migration.md
+20-3Lines changed: 20 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,14 +62,31 @@ application work still consumes a worker.
62
62
|`get_content`|`admit_body(body_policy{cap})`, then `co_await body().collect(cap)` or incremental `read_some()`| Admission before reads; typed limits, cancellation and protocol errors |
63
63
|`get_footers`|`body().trailers()` after end-of-body | Trailers remain separate from initial fields |
64
64
| Multipart uploaded-file map and cleanup callbacks |`forms::read_multipart`, `part_sink`, `temp_file_part_sink`, `temp_file_options::should_keep`| Limits are snapshotted at invocation; exchange and part sink remain borrowed through task completion. Partial parts abort exactly once; disk files clean up on abort/destruction; keep callback runs once per completed file, throws mean remove; client names sanitized |
65
-
|`get_cookie` / response `with_cookie`|Ordered Cookie/Set-Cookie fields; parse and render cookie values in application code| Preserve repeated fields; no native request/response convenience aliases |
Constraints: owned byte-transparent cookie pairs, no v2 classes, ordinary ordered fields, libhttpserver outcomes, one mandatory render validation boundary. Inspection finds no reusable public `result<T>`; existing HTTP helpers use optional or named result records.
4
+
5
+
| Alternative | Depth | Locality | Seam |
6
+
|---|---|---|---|
7
+
| Validated class with fluent setters and static parsing | Hides validation but many entry points | Every setter plus raw parse bypass | Raw input needs a second state representation |
8
+
| Owned aggregate plus explicit parse/render | Two operations hide tokenization, validation and date formatting | All emission checks in one renderer | Matches callers composing ordered fields |
9
+
| Field adapter parsing/adding Cookie/Set-Cookie automatically | Convenient repeated fields, wider interface | Couples cookie and field policies | Hides allocation and application failure decisions |
10
+
11
+
Choose owned `http::cookie`, `parse_cookie_header(string_view) -> vector<cookie>` and `render_set_cookie(cookie, string&) -> outcome`. The output reference follows atomic state replacement: errors leave output unchanged. Raw construction/mutation is explicit; validation is deferred until rendering, including parsed values. Applications append a successful value once as an ordinary Set-Cookie field. This deliberately migrates v2 fluent setters/throwing exceptions, not preserved wire semantics. No generic result framework or adapter.
12
+
13
+
Decision to refute: a single renderer can safely validate every raw construction path without losing lenient parser behavior.
| Borrowed input outlives parsing | Destroy/overwrite original input then render owned copies |
18
+
| Parsed CR or mutable attributes bypass safety | Explicit CR/name preconditions; typed failure and unchanged sentinel for CR/LF/NUL/semicolon and comma attributes |
19
+
| Whitespace/quotes change legacy parsing | Legacy code inspection: trim only SP/HT at token/name ends; retain value-leading whitespace, first equals, strip exactly one matching quote pair |
20
+
| Date overflows or depends on locale/timezone | C++20 civil date conversion with bounded years 0000..9999; epoch, negative second, leap day, extrema and int64 overflow tests; fixed English spelling |
21
+
| Unrelated executable proves named parity | Command path/suite match and real binary SHA-256, native positive execution, adversarial absent/mismatched/wrong-case/count/skip/completion fixtures |
22
+
| Allocation grows beyond input | Linear scan, one owned pair per nonempty input token; no cache/global state; input remains governed by existing field budgets |
23
+
| Reflection creates another wire message | Independent raw TCP managed/external consumer checks exact repeated response fields, rejected attempted injection and one response |
24
+
25
+
Rollback: revert the additive helper/registration before v3 API freeze. No persistent state changes. All interface doubts are cleared by the named native cases, real positive/provenance runner contracts, four lane receipts and installed managed/external raw-wire consumers in [implementation evidence](TASK-192-implementation-evidence.md). Ownership, injection, formatting and storage discriminators have no unresolved result.
0 commit comments