+ debug("no callback defined");
+ }
+ ub_resolve_free(result);
+ rbl_context_release(context);
+}
+
+static int rbl_handler(server_t *event, void *config)
+{
+ int retval = 0;
+ debug("rbl_handler called: ub_fd triggered");
+ epoll_modify(event->fd, 0, event);
+ if ((retval = ub_process(ctx)) != 0) {
+ err("error in DNS resolution: %s", ub_strerror(retval));
+ }
+ epoll_modify(event->fd, EPOLLIN, event);
+ return 0;
+}
+
+static inline bool rbl_dns_check(const char *hostname, rbl_result_t *result,
+ rbl_result_callback_t callback, void *data)
+{
+ if (ctx == NULL) {
+ ctx = ub_ctx_create();
+ ub_ctx_async(ctx, true);
+ if (server_register(ub_fd(ctx), rbl_handler, NULL) == NULL) {
+ crit("cannot register asynchronous DNS event handler");
+ abort();