aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver.h2
-rw-r--r--src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c5
2 files changed, 6 insertions, 1 deletions
diff --git a/src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver.h b/src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver.h
index ec9c631c38..55defa2f22 100644
--- a/src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver.h
+++ b/src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver.h
@@ -61,7 +61,7 @@ grpc_error *grpc_ares_ev_driver_create(grpc_ares_ev_driver **ev_driver,
grpc_pollset_set *pollset_set);
/* Destroys \a ev_driver asynchronously. The actual cleanup happens after
- grpc_ares_ev_driver_start() is called, or \ev_driver is already working. */
+ grpc_ares_ev_driver_start() is called, or \a ev_driver is already working. */
void grpc_ares_ev_driver_destroy(grpc_ares_ev_driver *ev_driver);
#endif /* GRPC_NATIVE_ADDRESS_RESOLVE */
diff --git a/src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c b/src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c
index 4faadf6184..5ecac86954 100644
--- a/src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c
+++ b/src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c
@@ -105,6 +105,8 @@ void grpc_ares_ev_driver_destroy(grpc_ares_ev_driver *ev_driver) {
ev_driver->closing = true;
}
+// Search fd in the fd_node list head. This is an O(n) search, the max possible
+// value of n is ARES_GETSOCK_MAXNUM (16).
static fd_node *get_fd(fd_node **head, int fd) {
fd_node dummy_head;
fd_node *node;
@@ -124,6 +126,7 @@ static fd_node *get_fd(fd_node **head, int fd) {
return NULL;
}
+// Process each file descriptor that may wake this callback up.
static void driver_cb(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
grpc_ares_ev_driver *d = arg;
size_t i;
@@ -147,6 +150,8 @@ ares_channel *grpc_ares_ev_driver_get_channel(grpc_ares_ev_driver *ev_driver) {
return &ev_driver->channel;
}
+// Get the file descriptors used by the ev_driver's ares channel, register
+// driver_closure with these filedescriptors.
static void grpc_ares_notify_on_event(grpc_exec_ctx *exec_ctx,
grpc_ares_ev_driver *ev_driver) {
size_t i;