projects
/
apps
/
pfixtools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Move some code.
[apps/pfixtools.git]
/
common
/
rbl.c
diff --git
a/common/rbl.c
b/common/rbl.c
index
d83d9df
..
4f8c23f
100644
(file)
--- a/
common/rbl.c
+++ b/
common/rbl.c
@@
-49,6
+49,7
@@
typedef struct rbl_context_t {
ARRAY(rbl_context_t);
static struct ub_ctx *ctx = NULL;
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)
static PA(rbl_context_t) ctx_pool = ARRAY_INIT;
static rbl_context_t *rbl_context_new(void)
@@
-89,6
+90,11
@@
static void rbl_exit(void)
ub_ctx_delete(ctx);
ctx = NULL;
}
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);
array_deep_wipe(ctx_pool, rbl_context_delete);
}
module_exit(rbl_exit);
@@
-134,7
+140,7
@@
static inline bool rbl_dns_check(const char *hostname, rbl_result_t *result,
if (ctx == NULL) {
ctx = ub_ctx_create();
ub_ctx_async(ctx, true);
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();
}
crit("cannot register asynchronous DNS event handler");
abort();
}