Skip to content

Commit 3832d3b

Browse files
etrclaude
andcommitted
Merge TASK-033: create_webserver builder cleanup (PRD-CFG-REQ-001..004)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2 parents e7f14c7 + a92ff88 commit 3832d3b

12 files changed

Lines changed: 622 additions & 667 deletions

File tree

README.md

Lines changed: 36 additions & 36 deletions
Large diffs are not rendered by default.

examples/external_event_loop.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ int main() {
4242
signal(SIGINT, signal_handler);
4343

4444
// EXTERNAL_SELECT runs MHD without an internal polling thread; the
45-
// application drives it via run_wait() below. no_thread_safety() can be
46-
// added for a small perf gain when the daemon is only ever touched from
47-
// a single thread, but it is omitted here for portability (some MHD
48-
// builds, notably Windows/MSYS2, reject that combination at start).
45+
// application drives it via run_wait() below. thread_safety(false) can
46+
// be added for a small perf gain when the daemon is only ever touched
47+
// from a single thread, but it is omitted here for portability (some
48+
// MHD builds, notably Windows/MSYS2, reject that combination at start).
4949
httpserver::webserver ws{httpserver::create_webserver(8080)
5050
.start_method(httpserver::http::http_utils::EXTERNAL_SELECT)};
5151

examples/file_upload.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ int main(int argc, char** argv) {
105105
std::cout << "Please make sure, that the given directory exists and is writeable" << std::endl;
106106

107107
httpserver::webserver ws{httpserver::create_webserver(8080)
108-
.no_put_processed_data_to_content()
108+
.put_processed_data_to_content(false)
109109
.file_upload_dir(std::string(argv[1]))
110110
.generate_random_filename_on_upload()
111111
.file_upload_target(httpserver::FILE_UPLOAD_DISK_ONLY)};

specs/tasks/M5-routing-lifecycle/TASK-033.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
Halve the builder's surface by collapsing each paired `foo()/no_foo()` to `foo(bool = true)`, and validate inputs at the build step.
99

1010
**Action Items:**
11-
- [ ] Inventory every `no_*` setter in `create_webserver.hpp` (`no_ssl`, `no_debug`, `no_pedantic`, `no_basic_auth`, `no_digest_auth`, `no_deferred`, `no_regex_checking`, `no_ban_system`, `no_post_process`, `no_single_resource`, `no_ipv6`, `no_dual_stack`, etc.).
12-
- [ ] Replace each with a single `foo(bool enable = true)` setter; remove the corresponding `no_foo()`.
13-
- [ ] Validate at the setter (or at `webserver` construction) and throw `std::invalid_argument` with a descriptive message:
11+
- [x] Inventory every `no_*` setter in `create_webserver.hpp` (`no_ssl`, `no_debug`, `no_pedantic`, `no_basic_auth`, `no_digest_auth`, `no_deferred`, `no_regex_checking`, `no_ban_system`, `no_post_process`, `no_single_resource`, `no_ipv6`, `no_dual_stack`, etc.).
12+
- [x] Replace each with a single `foo(bool enable = true)` setter; remove the corresponding `no_foo()`.
13+
- [x] Validate at the setter (or at `webserver` construction) and throw `std::invalid_argument` with a descriptive message:
1414
- port > 65535
1515
- threads < 0
1616
- any setter receiving an obviously bogus value (negative timeouts, zero buffer sizes, etc.)
17-
- [ ] Update internal callers, tests, and examples to use the new boolean-arg form.
18-
- [ ] Confirm `create_webserver.hpp` line count drops by ≥30% (PRD §3.3 acceptance).
17+
- [x] Update internal callers, tests, and examples to use the new boolean-arg form.
18+
- [x] Confirm `create_webserver.hpp` line count drops by ≥30% (PRD §3.3 acceptance).
1919

2020
**Dependencies:**
2121
- Blocked by: TASK-006, TASK-014
@@ -31,4 +31,4 @@ Halve the builder's surface by collapsing each paired `foo()/no_foo()` to `foo(b
3131
**Related Requirements:** PRD-CFG-REQ-001, PRD-CFG-REQ-002, PRD-CFG-REQ-003, PRD-CFG-REQ-004
3232
**Related Decisions:** §4.9
3333

34-
**Status:** Not Started
34+
**Status:** Done

specs/tasks/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ Nominally: **13 sequential tasks**, each S–XL. Most other tasks parallelize of
115115
| TASK-030 | `_handler` suffix renames + `explicit` constructor | M5 | Done | TASK-014 |
116116
| TASK-031 | Handler error-propagation contract (DR-009) | M5 | Done | TASK-027, TASK-030 |
117117
| TASK-032 | Thread-safety contract stress test (DR-008) | M5 | Done | TASK-027, TASK-031 |
118-
| TASK-033 | `create_webserver` builder cleanup | M5 | Not Started | TASK-006, TASK-014 |
118+
| TASK-033 | `create_webserver` builder cleanup | M5 | Done | TASK-006, TASK-014 |
119119
| TASK-034 | Build-flag-independent public API + `webserver::features()` | M5 | Not Started | TASK-003, TASK-019, TASK-033 |
120120
| TASK-035 | Smart-pointer `register_ws_resource` overloads | M5 | Not Started | TASK-014, TASK-034 |
121121
| TASK-036 | Handler return-by-value dispatch cutover | M5 | Not Started | TASK-022, TASK-025, TASK-027, TASK-031 |

specs/unworked_review_issues/2026-05-13_220709_task-033.md

Lines changed: 157 additions & 0 deletions
Large diffs are not rendered by default.

src/create_webserver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ create_webserver& create_webserver::bind_address(const std::string& ip) {
6262
return *this;
6363
}
6464

65-
throw std::invalid_argument("Invalid IP address: " + ip);
65+
throw std::invalid_argument("bind_address: invalid IP address: " + ip);
6666
}
6767

6868
} // namespace httpserver

0 commit comments

Comments
 (0)