NetworkedApplications: protocol/overload matrix with bounded timeouts and header limits (P-NETWORKED-06)

This commit is contained in:
faumaray committed 2026-12-04 10:26:09 +03:00
1 parent 2da3971760
commit 21b1c8422d
4 files changed
+285

No files matched your search

@@ -116,6 +116,14 @@ namespace NetworkedKv
return std::unexpected{config_error(
"NetworkedConfig: max_request_bytes must be positive")};
}
if (max_header_bytes == 0) {
return std::unexpected{config_error(
"NetworkedConfig: max_header_bytes must be positive")};
}
if (read_timeout.count() <= 0 || write_timeout.count() <= 0) {
return std::unexpected{config_error(
"NetworkedConfig: read/write timeouts must be positive")};
}
if (max_scan_page == 0) {
return std::unexpected{
config_error("NetworkedConfig: max_scan_page must be positive")};
@@ -257,6 +265,9 @@ namespace NetworkedKv
options.bind_host = std::move(host);
options.port = port;
options.max_body_bytes = m_config.max_request_bytes;
options.max_header_bytes = m_config.max_header_bytes;
options.read_timeout = m_config.read_timeout;
options.write_timeout = m_config.write_timeout;
options.max_concurrent_connections = m_config.max_connections;
auto server = std::make_unique<Void::Net::HttpServer>(options);
auto add = [&](Void::Net::Method method, const char* pattern) {
@@ -362,6 +373,9 @@ namespace NetworkedKv
candidate.storage_path != m_config.storage_path ||
candidate.max_connections != m_config.max_connections ||
candidate.max_request_bytes != m_config.max_request_bytes ||
candidate.max_header_bytes != m_config.max_header_bytes ||
candidate.read_timeout != m_config.read_timeout ||
candidate.write_timeout != m_config.write_timeout ||
candidate.max_scan_page != m_config.max_scan_page) {
return std::unexpected{state_error(
"NetworkedApplication: listener, storage and limit changes "