From f16493f468119ca2caac223c2d822ce14c43648b Mon Sep 17 00:00:00 2001 From: Elizabeth Myers Date: Mon, 27 Jun 2016 18:24:39 -0500 Subject: [PATCH] blacklist: give different messages for cancellation and timeout --- authd/providers/blacklist.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/authd/providers/blacklist.c b/authd/providers/blacklist.c index b0522c70..77178270 100644 --- a/authd/providers/blacklist.c +++ b/authd/providers/blacklist.c @@ -392,7 +392,7 @@ blacklists_initiate(struct auth_client *auth, uint32_t provider) } static void -blacklists_cancel(struct auth_client *auth) +blacklists_generic_cancel(struct auth_client *auth, const char *message) { rb_dlink_node *ptr, *nptr; struct blacklist_user *bluser = get_provider_data(auth, SELF_PID); @@ -402,7 +402,7 @@ blacklists_cancel(struct auth_client *auth) if(rb_dlink_list_length(&bluser->queries)) { - notice_client(auth->cid, "*** Aborting DNS blacklist queries"); + notice_client(auth->cid, message); RB_DLINK_FOREACH_SAFE(ptr, nptr, bluser->queries.head) { @@ -424,6 +424,18 @@ blacklists_cancel(struct auth_client *auth) auth_client_unref(auth); } +static void +blacklists_cancel(struct auth_client *auth) +{ + blacklists_generic_cancel(auth, "*** Aborting DNS blacklist checks"); +} + +static void +blacklists_timeout(struct auth_client *auth) +{ + blacklists_generic_cancel(auth, "*** DNS blacklist checks timed out"); +} + static void blacklists_destroy(void) { @@ -568,7 +580,7 @@ struct auth_provider blacklist_provider = .destroy = blacklists_destroy, .start = blacklists_start, .cancel = blacklists_cancel, - .timeout = blacklists_cancel, + .timeout = blacklists_timeout, .completed = blacklists_initiate, .opt_handlers = blacklist_options, /* .stats_handler = { 'B', blacklist_stats }, */