aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorlevlam <levlam@telegram.org>2026-06-11 14:23:55 +0300
committerlevlam <levlam@telegram.org>2026-06-11 14:23:55 +0300
commit59fdcc9bafadfa84a2de9ee6ea2c8e65378861b2 (patch)
treea13f2910ab03ce4f5eda60552ee3a2b72bb89745
parentf0658f9572304eb1c281831d067dc018b50bb6bb (diff)
Add names constants for HTTP server parameters.
-rw-r--r--telegram-bot-api/HttpServer.h9
1 files 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<td::TcpListener> 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<td::HttpInboundConnection>("HttpInboundConnection", td::BufferedFd<td::SocketFd>(std::move(fd)), 0,
- 50, 500, creator_(), SharedData::get_slow_incoming_http_scheduler_id())
+ td::create_actor<td::HttpInboundConnection>("HttpInboundConnection", td::BufferedFd<td::SocketFd>(std::move(fd)),
+ MAX_IN_MEMORY_POST_SIZE, MAX_FILE_COUNT, IDLE_TIMEOUT, creator_(),
+ SharedData::get_slow_incoming_http_scheduler_id())
.release();
}