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
Collapse 17 paired `foo()/no_foo()` setters into single
`foo(bool enable = true)` setters on create_webserver, rename the
remaining one-way negative flags (`no_listen_socket`, `no_thread_safety`,
`no_alpn`) to their positive counterparts (`listen_socket`,
`thread_safety`, `alpn`), and add setter-time validation that throws
`std::invalid_argument` with a parameter-named message:
- port: int overload validates [0, 65535]; uint16_t overload preserved
- max_threads, max_connections, memory_limit, connection_timeout,
per_IP_connection_limit, max_thread_stack_size, nonce_nc_size,
listen_backlog, address_reuse, tcp_fastopen_queue_size: reject < 0
- client_discipline_level: reject < -1 (-1 is the unset sentinel)
- file_upload_dir: reject empty string
- bind_address(string): error message now prefixed with "bind_address:"
Header collapsed from 593 lines (feature/v2.0) / 554 lines (master
baseline) to 253 lines — 54% under the v1 baseline (PRD §3.3 target
was 30%). Acceptance grep
`grep -E '^\s*create_webserver& no_' src/httpserver/create_webserver.hpp`
now returns empty. Internal `webserver`-side field names
(`no_listen_socket`, `no_thread_safety`, `no_alpn`) are unchanged so
`webserver.cpp` does not churn — only the public API is renamed.
Tests: new unit tests in test/unit/create_webserver_test.cpp cover
port-out-of-range, every numeric validator, file_upload_dir empty,
bind_address parameter-name message, and the bool-arg shape for every
toggled flag (including the renamed listen_socket/thread_safety/alpn
and widened tcp_nodelay/turbo/suppress_date_header/sigpipe_handled_by_app).
77 tests, 81 checks pass. Full `make check` green (42/42).
Internal callers rewritten: test/integ/ws_start_stop.cpp,
test/integ/file_upload.cpp, test/unit/routing_regression_test.cpp,
examples/file_upload.cpp, examples/external_event_loop.cpp (comment).
README.md updated to document the bool-arg public API.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments