Don't inherit Td from NetQueryCallback.

This commit is contained in:
levlam 2021-09-10 18:58:36 +03:00
parent 088c3169d4
commit 78baa7977b
2 changed files with 3 additions and 4 deletions

View File

@ -3337,7 +3337,6 @@ void Td::invalidate_handler(ResultHandler *handler) {
void Td::send(NetQueryPtr &&query) {
VLOG(net_query) << "Send " << query << " to dispatcher";
query->debug("Td: send to NetQueryDispatcher");
query->set_callback(actor_shared(this, 1));
G()->net_query_dispatcher().dispatch(std::move(query));
}
@ -3566,7 +3565,7 @@ void Td::hangup_shared() {
auto type = Container<int>::type_from_id(token);
if (type == RequestActorIdType) {
request_actors_.erase(get_link_token());
request_actors_.erase(token);
dec_request_actor_refcnt();
} else if (type == ActorIdType) {
dec_actor_refcnt();

View File

@ -89,7 +89,7 @@ extern int VERBOSITY_NAME(td_requests);
//
// Parent needs a way to know that it will receive no more updates.
// It happens after destruction of callback or after on_closed.
class Td final : public NetQueryCallback {
class Td final : public Actor {
public:
Td(const Td &) = delete;
Td(Td &&) = delete;
@ -113,7 +113,7 @@ class Td final : public NetQueryCallback {
void on_update(BufferSlice &&update);
void on_result(NetQueryPtr query) final;
void on_result(NetQueryPtr query);
void on_update_server_time_difference();