summaryrefslogtreecommitdiff
path: root/src/resolv
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2013-04-02 16:24:54 +0200
committerJakub Hrozek <jhrozek@redhat.com>2013-04-03 14:42:00 +0200
commit44fc7e53b403d45576ab61d2dea4608e323ed332 (patch)
treea5af545b70786be1af7bbd0c3299c41aaed48279 /src/resolv
parent584eda085e83a428f2c39dadf0d7adeaff5c87f4 (diff)
downloadsssd-44fc7e53b403d45576ab61d2dea4608e323ed332.tar.gz
sssd-44fc7e53b403d45576ab61d2dea4608e323ed332.tar.bz2
sssd-44fc7e53b403d45576ab61d2dea4608e323ed332.zip
Centralize resolv_init, remove resolv context list
Diffstat (limited to 'src/resolv')
-rw-r--r--src/resolv/async_resolv.c19
-rw-r--r--src/resolv/async_resolv.h2
2 files changed, 3 insertions, 18 deletions
diff --git a/src/resolv/async_resolv.c b/src/resolv/async_resolv.c
index dce321e0..60d9e05b 100644
--- a/src/resolv/async_resolv.c
+++ b/src/resolv/async_resolv.c
@@ -78,11 +78,6 @@ struct fd_watch {
};
struct resolv_ctx {
- /* Contexts are linked so we can keep track of them and re-create
- * the ares channels in all of them at once if we need to. */
- struct resolv_ctx *prev;
- struct resolv_ctx *next;
-
struct tevent_context *ev_ctx;
ares_channel channel;
@@ -109,8 +104,6 @@ struct resolv_request {
struct tevent_timer *request_timeout;
};
-struct resolv_ctx *context_list;
-
static int
return_code(int ares_code)
{
@@ -406,8 +399,6 @@ resolv_ctx_destructor(struct resolv_ctx *ctx)
{
ares_channel channel;
- DLIST_REMOVE(context_list, ctx);
-
if (ctx->channel == NULL) {
DEBUG(1, ("Ares channel already destroyed?\n"));
return -1;
@@ -487,7 +478,6 @@ resolv_init(TALLOC_CTX *mem_ctx, struct tevent_context *ev_ctx,
goto done;
}
- DLIST_ADD(context_list, ctx);
talloc_set_destructor(ctx, resolv_ctx_destructor);
*ctxp = ctx;
@@ -499,14 +489,9 @@ done:
}
void
-resolv_reread_configuration(void)
+resolv_reread_configuration(struct resolv_ctx *ctx)
{
- struct resolv_ctx *ctx;
-
- DEBUG(4, ("Recreating all c-ares channels\n"));
- DLIST_FOR_EACH(ctx, context_list) {
- recreate_ares_channel(ctx);
- }
+ recreate_ares_channel(ctx);
}
static errno_t
diff --git a/src/resolv/async_resolv.h b/src/resolv/async_resolv.h
index f6c72b4f..b66bf9da 100644
--- a/src/resolv/async_resolv.h
+++ b/src/resolv/async_resolv.h
@@ -58,7 +58,7 @@ struct resolv_ctx;
int resolv_init(TALLOC_CTX *mem_ctx, struct tevent_context *ev_ctx,
int timeout, struct resolv_ctx **ctxp);
-void resolv_reread_configuration(void);
+void resolv_reread_configuration(struct resolv_ctx *ctx);
const char *resolv_strerror(int ares_code);