From 59fdcc9bafadfa84a2de9ee6ea2c8e65378861b2 Mon Sep 17 00:00:00 2001 From: levlam Date: Thu, 11 Jun 2026 14:23:55 +0300 Subject: Add names constants for HTTP server parameters. --- telegram-bot-api/HttpServer.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/telegram-bot-api/HttpServer.h b/telegram-bot-api/HttpServer.h index a4a44e2..1ffa2a5 100644 --- a/telegram-bot-api/HttpServer.h +++ b/telegram-bot-api/HttpServer.h @@ -42,6 +42,10 @@ class HttpServer final : public td::TcpListener::Callback { td::ActorOwn listener_; td::FloodControlFast flood_control_; + static constexpr std::size_t MAX_IN_MEMORY_POST_SIZE = 0; + static constexpr std::size_t MAX_FILE_COUNT = 50; + static constexpr td::int32 IDLE_TIMEOUT = 500; + void start_up() final { auto now = td::Time::now(); auto wakeup_at = flood_control_.get_wakeup_at(); @@ -63,8 +67,9 @@ class HttpServer final : public td::TcpListener::Callback { } void accept(td::SocketFd fd) final { - td::create_actor("HttpInboundConnection", td::BufferedFd(std::move(fd)), 0, - 50, 500, creator_(), SharedData::get_slow_incoming_http_scheduler_id()) + td::create_actor("HttpInboundConnection", td::BufferedFd(std::move(fd)), + MAX_IN_MEMORY_POST_SIZE, MAX_FILE_COUNT, IDLE_TIMEOUT, creator_(), + SharedData::get_slow_incoming_http_scheduler_id()) .release(); } -- cgit v1.2.3