Add check that RequestHandler sends at most one request.
This commit is contained in:
parent
4762983803
commit
85c30e5dd2
@ -160,6 +160,8 @@ void Td::ResultHandler::set_td(Td *td) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Td::ResultHandler::send_query(NetQueryPtr query) {
|
void Td::ResultHandler::send_query(NetQueryPtr query) {
|
||||||
|
CHECK(!is_query_sent_)
|
||||||
|
is_query_sent_ = true;
|
||||||
td_->add_handler(query->id(), shared_from_this());
|
td_->add_handler(query->id(), shared_from_this());
|
||||||
query->debug("Send to NetQueryDispatcher");
|
query->debug("Send to NetQueryDispatcher");
|
||||||
G()->net_query_dispatcher().dispatch(std::move(query));
|
G()->net_query_dispatcher().dispatch(std::move(query));
|
||||||
|
@ -227,6 +227,7 @@ class Td final : public Actor {
|
|||||||
void send_query(NetQueryPtr query);
|
void send_query(NetQueryPtr query);
|
||||||
|
|
||||||
Td *td_ = nullptr;
|
Td *td_ = nullptr;
|
||||||
|
bool is_query_sent_ = false;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void set_td(Td *td);
|
void set_td(Td *td);
|
||||||
|
Loading…
Reference in New Issue
Block a user