Fixed queues wait choice

This commit is contained in:
Andrea Cavalli 2020-09-02 01:54:55 +02:00
parent 4f2230d1d6
commit a01b7bebd9

View File

@ -342,8 +342,12 @@ class TdReceiver {
if (timeout != 0) {
if (include_responses && !include_updates) {
output_responses_queue_->reader_get_event_fd().wait(static_cast<int>(timeout * 1000));
} else {
} else if (!include_responses && include_updates) {
output_updates_queue_->reader_get_event_fd().wait(static_cast<int>(timeout * 1000));
} else if (include_responses && include_updates) {
output_updates_queue_->reader_get_event_fd().wait(static_cast<int>(timeout * 1000));
} else {
// do nothing, this configuration shouldn't be used.
}
return receive_unlocked(0, include_responses, include_updates);
}