ares_queue_wait_empty() does not honor timeout_ms >= 0

There is a missing break statement in the case that timeout_ms >= 0
leading to a possible infinite loop.

Fixes Issue: #742
Fix By: Brad House (@bradh352)
pull/747/head
Brad House 11 months ago
parent fd81f36d3e
commit 13f677a6f3
  1. 4
      src/lib/ares__threads.c

@ -585,6 +585,10 @@ ares_status_t ares_queue_wait_empty(ares_channel_t *channel, int timeout_ms)
status =
ares__thread_cond_timedwait(channel->cond_empty, channel->lock, tms);
}
/* Either there was a timeout or we were signaled that the queue was
* empty. Don't loop */
break;
}
}
ares__thread_mutex_unlock(channel->lock);

Loading…
Cancel
Save