mirror of https://github.com/getdnsapi/getdns.git
Don't assume mini_event loop
This commit is contained in:
parent
47b77c948a
commit
973fcbddcc
|
@ -2392,8 +2392,10 @@ getdns_context_get_num_pending_requests(struct getdns_context* context,
|
||||||
context->extension->vmt->run_once(context->extension, 0);
|
context->extension->vmt->run_once(context->extension, 0);
|
||||||
|
|
||||||
/* TODO: Remove this when next_timeout is gone */
|
/* TODO: Remove this when next_timeout is gone */
|
||||||
|
if (context->extension == &context->mini_event.loop)
|
||||||
_getdns_handle_timeouts(context->mini_event.base,
|
_getdns_handle_timeouts(context->mini_event.base,
|
||||||
&context->mini_event.time_tv, next_timeout ? next_timeout : &dispose);
|
&context->mini_event.time_tv,
|
||||||
|
next_timeout ? next_timeout : &dispose);
|
||||||
|
|
||||||
return context->outbound_requests.count;
|
return context->outbound_requests.count;
|
||||||
}
|
}
|
||||||
|
@ -2418,9 +2420,13 @@ getdns_context_process_async(struct getdns_context* context)
|
||||||
void
|
void
|
||||||
getdns_context_run(getdns_context *context)
|
getdns_context_run(getdns_context *context)
|
||||||
{
|
{
|
||||||
|
if (context->extension == &context->mini_event.loop) {
|
||||||
if (getdns_context_get_num_pending_requests(context, NULL) > 0 &&
|
if (getdns_context_get_num_pending_requests(context, NULL) > 0 &&
|
||||||
!getdns_context_process_async(context))
|
!getdns_context_process_async(context))
|
||||||
context->extension->vmt->run(context->extension);
|
context->extension->vmt->run(context->extension);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
context->extension->vmt->run(context->extension);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct timeout_accumulator {
|
typedef struct timeout_accumulator {
|
||||||
|
|
Loading…
Reference in New Issue