mirror of https://github.com/getdnsapi/getdns.git
get current (pluggable) eventloop from context
So applications can schedule events against it...
This commit is contained in:
parent
22095f23f6
commit
2873645068
|
@ -3266,6 +3266,20 @@ getdns_context_set_eventloop(getdns_context* context, getdns_eventloop* loop)
|
|||
return GETDNS_RETURN_GOOD;
|
||||
}
|
||||
|
||||
getdns_return_t
|
||||
getdns_context_get_eventloop(getdns_context *context, getdns_eventloop **loop)
|
||||
{
|
||||
if (!context || !loop)
|
||||
return GETDNS_RETURN_INVALID_PARAMETER;
|
||||
|
||||
if (!context->extension)
|
||||
return GETDNS_RETURN_GENERIC_ERROR;
|
||||
else
|
||||
*loop = context->extension;
|
||||
|
||||
return GETDNS_RETURN_GOOD;
|
||||
}
|
||||
|
||||
static in_port_t
|
||||
upstream_port(getdns_upstream *upstream)
|
||||
{
|
||||
|
|
|
@ -119,6 +119,11 @@ getdns_return_t
|
|||
getdns_context_set_eventloop(getdns_context* context,
|
||||
getdns_eventloop *eventloop);
|
||||
|
||||
/* get the currently active (pluggable) eventloop from the context */
|
||||
getdns_return_t
|
||||
getdns_context_get_eventloop(getdns_context* context,
|
||||
getdns_eventloop **eventloop);
|
||||
|
||||
/* detach the eventloop from the context */
|
||||
getdns_return_t
|
||||
getdns_context_detach_eventloop(getdns_context *context);
|
||||
|
|
Loading…
Reference in New Issue