ARRAY(rbl_context_t);
static struct ub_ctx *ctx = NULL;
+static server_t *async_event = NULL;
static PA(rbl_context_t) ctx_pool = ARRAY_INIT;
static rbl_context_t *rbl_context_new(void)
ub_ctx_delete(ctx);
ctx = NULL;
}
+ if (async_event != NULL) {
+ async_event->fd = -1;
+ server_release(async_event);
+ async_event = NULL;
+ }
array_deep_wipe(ctx_pool, rbl_context_delete);
}
module_exit(rbl_exit);
if (ctx == NULL) {
ctx = ub_ctx_create();
ub_ctx_async(ctx, true);
- if (server_register(ub_fd(ctx), rbl_handler, NULL) == NULL) {
+ if ((async_event = server_register(ub_fd(ctx), rbl_handler, NULL)) == NULL) {
crit("cannot register asynchronous DNS event handler");
abort();
}