Merge pull request #83 from a5r0n/fix/no-file-limit

fix no_file_limit typo
This commit is contained in:
Andrea Cavalli 2023-12-16 20:58:44 +01:00 committed by GitHub
commit b3eb1acc91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;