fix: fix no_file_limit typo

This commit is contained in:
a5r0n 2023-12-15 11:58:46 +02:00
parent e18ecceee4
commit bf66a41987
No known key found for this signature in database
GPG Key ID: 2D8D4CB7D7EA9A53
2 changed files with 3 additions and 3 deletions

View File

@ -5572,7 +5572,7 @@ void Client::on_update_file(object_ptr<td_api::file> file) {
if (!is_file_being_downloaded(file_id)) {
return;
}
if ((!parameters_->local_mode_ || !parameters_->no_file_limit_) && file->local_->downloaded_size_ > MAX_DOWNLOAD_FILE_SIZE) {
if ((!parameters_->local_mode_ && !parameters_->no_file_limit_) && file->local_->downloaded_size_ > MAX_DOWNLOAD_FILE_SIZE) {
if (file->local_->is_downloading_active_) {
send_request(make_object<td_api::cancelDownloadFile>(file_id, false),
td::make_unique<TdOnCancelDownloadFileCallback>());
@ -11099,7 +11099,7 @@ void Client::process_register_user_query(PromisedQueryPtr &query) {
//end custom auth methods impl
void Client::do_get_file(object_ptr<td_api::file> file, PromisedQueryPtr query) {
if ((!parameters_->local_mode_ || !parameters_->no_file_limit_) &&
if ((!parameters_->local_mode_ && !parameters_->no_file_limit_) &&
td::max(file->expected_size_, file->local_->downloaded_size_) > MAX_DOWNLOAD_FILE_SIZE) { // speculative check
return fail_query(400, "Bad Request: file is too big", std::move(query));
}

View File

@ -72,7 +72,7 @@ struct ClientParameters {
bool local_mode_ = false;
bool allow_http_ = false;
bool use_relative_path_ = false;
bool no_file_limit_ = true;
bool no_file_limit_ = false;
bool allow_users_ = false;
bool allow_users_registration_ = false;
bool stats_hide_sensible_data_ = false;