mirror of
https://github.com/tdlight-team/tdlight-telegram-bot-api.git
synced 2024-11-23 12:36:51 +01:00
Safer handling of negative monotonic time.
This commit is contained in:
parent
79134758a8
commit
4d025b1c9b
@ -3198,6 +3198,11 @@ void Client::start_up() {
|
|||||||
next_bot_updates_warning_time_ = start_time_ + 600;
|
next_bot_updates_warning_time_ = start_time_ + 600;
|
||||||
schedule_next_delete_messages_lru();
|
schedule_next_delete_messages_lru();
|
||||||
webhook_set_time_ = start_time_;
|
webhook_set_time_ = start_time_;
|
||||||
|
next_allowed_set_webhook_time_ = start_time_;
|
||||||
|
next_set_webhook_logging_time_ = start_time_;
|
||||||
|
next_webhook_is_not_modified_warning_time_ = start_time_;
|
||||||
|
previous_get_updates_start_time_ = start_time_ - 100;
|
||||||
|
previous_get_updates_finish_time_ = start_time_ - 100;
|
||||||
|
|
||||||
sticker_set_names_[GREAT_MINDS_SET_ID] = GREAT_MINDS_SET_NAME.str();
|
sticker_set_names_[GREAT_MINDS_SET_ID] = GREAT_MINDS_SET_NAME.str();
|
||||||
|
|
||||||
|
@ -647,7 +647,7 @@ void WebhookActor::handle(td::unique_ptr<td::HttpQuery> response) {
|
|||||||
void WebhookActor::start_up() {
|
void WebhookActor::start_up() {
|
||||||
max_loaded_updates_ = max_connections_ * 2;
|
max_loaded_updates_ = max_connections_ * 2;
|
||||||
|
|
||||||
last_success_time_ = td::Time::now();
|
next_ip_address_resolve_time_ = last_success_time_ = td::Time::now();
|
||||||
active_new_connection_flood_.add_limit(1, 10 * max_connections_);
|
active_new_connection_flood_.add_limit(1, 10 * max_connections_);
|
||||||
active_new_connection_flood_.add_limit(5, 20 * max_connections_);
|
active_new_connection_flood_.add_limit(5, 20 * max_connections_);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user