Fix request errors during closing.
GitOrigin-RevId: 6587b35bcb7aef082686a93e75ae8b891113da0b
This commit is contained in:
parent
f7393d2717
commit
29f3c91596
@ -3457,7 +3457,7 @@ void Td::request(uint64 id, tl_object_ptr<td_api::Function> function) {
|
||||
pending_preauthentication_requests_.emplace_back(id, std::move(function));
|
||||
return;
|
||||
}
|
||||
return send_error_raw(id, 401, "Initialization parameters are needed: call setTdlibParameters first");
|
||||
return send_error_raw(id, 400, "Initialization parameters are needed: call setTdlibParameters first");
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -3486,12 +3486,16 @@ void Td::request(uint64 id, tl_object_ptr<td_api::Function> function) {
|
||||
pending_preauthentication_requests_.emplace_back(id, std::move(function));
|
||||
return;
|
||||
}
|
||||
return send_error_raw(id, 401, "Database encryption key is needed: call checkDatabaseEncryptionKey first");
|
||||
return send_error_raw(id, 400, "Database encryption key is needed: call checkDatabaseEncryptionKey first");
|
||||
}
|
||||
return answer_ok_query(id, init(as_db_key(encryption_key)));
|
||||
}
|
||||
case State::Close:
|
||||
return send_error_raw(id, 401, "Unauthorized");
|
||||
if (destroy_flag_) {
|
||||
return send_error_raw(id, 401, "Unauthorized");
|
||||
} else {
|
||||
return send_error_raw(id, 500, "Request aborted");
|
||||
}
|
||||
case State::Run:
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user