summaryrefslogtreecommitdiff
path: root/server/resolv/async_resolv.c
diff options
context:
space:
mode:
authorMartin Nagy <mnagy@redhat.com>2010-01-13 17:03:53 +0100
committerStephen Gallagher <sgallagh@redhat.com>2010-01-14 09:00:08 -0500
commit9654795a488f0094f525ef505353fd5de4e6878f (patch)
tree381cb9294f6287111cb14512e86b2b5140765b90 /server/resolv/async_resolv.c
parent2d53bb82d617be1866762bf3b3c19fc31941b41c (diff)
downloadsssd-9654795a488f0094f525ef505353fd5de4e6878f.tar.gz
sssd-9654795a488f0094f525ef505353fd5de4e6878f.tar.bz2
sssd-9654795a488f0094f525ef505353fd5de4e6878f.zip
Don't recursively call ares_process_fd() from fd_event()
Since ares_process_fd() might also cause fd_event() to be called again, calling ares_process_fd() is unwise. The bug will cause a crash if c-ares is using tcp connections. Fixes: #384
Diffstat (limited to 'server/resolv/async_resolv.c')
-rw-r--r--server/resolv/async_resolv.c17
1 files changed, 0 insertions, 17 deletions
diff --git a/server/resolv/async_resolv.c b/server/resolv/async_resolv.c
index 5fd4084b..ff84b386 100644
--- a/server/resolv/async_resolv.c
+++ b/server/resolv/async_resolv.c
@@ -195,7 +195,6 @@ unschedule_timeout_watcher(struct resolv_ctx *ctx)
}
static void fd_event_add(struct resolv_ctx *ctx, int s);
-static void fd_event_write(struct resolv_ctx *ctx, int s);
static void fd_event_close(struct resolv_ctx *ctx, int s);
/*
@@ -216,11 +215,6 @@ fd_event(void *data, int s, int fd_read, int fd_write)
return;
}
- /* If ares needs to write to a descriptor */
- if (fd_write == 1) {
- fd_event_write(ctx, s);
- }
-
/* Are we already watching this file descriptor? */
watch = ctx->fds;
while (watch) {
@@ -260,17 +254,6 @@ fd_event_add(struct resolv_ctx *ctx, int s)
}
static void
-fd_event_write(struct resolv_ctx *ctx, int s)
-{
- if (ctx->channel == NULL) {
- DEBUG(1, ("Invalid ares channel - this is likely a bug\n"));
- return;
- }
- /* do not allow any read. */
- ares_process_fd(ctx->channel, ARES_SOCKET_BAD, s);
-}
-
-static void
fd_event_close(struct resolv_ctx *ctx, int s)
{
struct fd_watch *watch;