Improve RequestActor td_ private field name.

This commit is contained in:
levlam 2021-11-08 15:26:22 +03:00
parent 616b0e6d6f
commit 2f1821a6c4
2 changed files with 204 additions and 202 deletions

View File

@ -26,7 +26,7 @@ template <class T = Unit>
class RequestActor : public Actor {
public:
RequestActor(ActorShared<Td> td_id, uint64 request_id)
: td_id_(std::move(td_id)), td(td_id_.get().get_actor_unsafe()), request_id_(request_id) {
: td_id_(std::move(td_id)), td_(td_id_.get().get_actor_unsafe()), request_id_(request_id) {
}
void loop() override {
@ -65,8 +65,8 @@ class RequestActor : public Actor {
auto error = future_.move_as_error();
if (error == Status::Error<FutureActor<T>::HANGUP_ERROR_CODE>()) {
// dropping query due to lost authorization or lost promise
// td may be already closed, so we should check is auth_manager_ is empty
bool is_authorized = td->auth_manager_ && td->auth_manager_->is_authorized();
// Td may be already closed, so we should check is auth_manager_ is empty
bool is_authorized = td_->auth_manager_ && td_->auth_manager_->is_authorized();
if (is_authorized) {
LOG(ERROR) << "Promise was lost";
do_send_error(Status::Error(500, "Query can't be answered due to a bug in TDLib"));
@ -101,7 +101,7 @@ class RequestActor : public Actor {
protected:
ActorShared<Td> td_id_;
Td *td;
Td *td_;
void send_result(tl_object_ptr<td_api::Object> &&result) {
send_closure(td_id_, &Td::send_result, request_id_, std::move(result));

File diff suppressed because it is too large Load Diff