Safer handling of negative monotonic time.

This commit is contained in:
levlam 2020-11-21 17:46:18 +03:00
parent 79134758a8
commit 4d025b1c9b
2 changed files with 6 additions and 1 deletions

View File

@ -3198,6 +3198,11 @@ void Client::start_up() {
next_bot_updates_warning_time_ = start_time_ + 600;
schedule_next_delete_messages_lru();
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();

View File

@ -647,7 +647,7 @@ void WebhookActor::handle(td::unique_ptr<td::HttpQuery> response) {
void WebhookActor::start_up() {
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(5, 20 * max_connections_);