Mercurial > dovecot > core-2.2
changeset 11501:149d57c1a9c0 HEAD
auth: Abort pending penalty lookups earlier in deinit.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Tue, 08 Jun 2010 20:52:24 +0100 |
parents | 6f85840f8171 |
children | 1aaa4b51cb14 |
files | src/auth/auth-request-handler.c src/auth/main.c |
diffstat | 2 files changed, 8 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/auth/auth-request-handler.c Tue Jun 08 20:51:59 2010 +0100 +++ b/src/auth/auth-request-handler.c Tue Jun 08 20:52:24 2010 +0100 @@ -185,8 +185,10 @@ request->delayed_failure = TRUE; handler->refcount++; - auth_penalty_update(auth_penalty, request, - request->last_penalty + 1); + if (auth_penalty != NULL) { + auth_penalty_update(auth_penalty, request, + request->last_penalty + 1); + } auth_request_refresh_last_access(request); aqueue_append(auth_failures, &request); @@ -221,7 +223,7 @@ case AUTH_CLIENT_RESULT_SUCCESS: auth_request_proxy_finish(request, TRUE); - if (request->last_penalty != 0) { + if (request->last_penalty != 0 && auth_penalty != NULL) { /* reset penalty */ auth_penalty_update(auth_penalty, request, 0); } @@ -445,8 +447,7 @@ handler->refcount++; /* before we start authenticating, see if we need to wait first */ - auth_penalty_lookup(auth_penalty, request, - auth_penalty_callback); + auth_penalty_lookup(auth_penalty, request, auth_penalty_callback); return TRUE; }
--- a/src/auth/main.c Tue Jun 08 20:51:59 2010 +0100 +++ b/src/auth/main.c Tue Jun 08 20:52:24 2010 +0100 @@ -151,6 +151,8 @@ static void main_deinit(void) { + /* cancel all pending anvil penalty lookups */ + auth_penalty_deinit(&auth_penalty); /* deinit auth workers, which aborts pending requests */ auth_worker_server_deinit(); /* deinit passdbs and userdbs. it aborts any pending async requests. */ @@ -168,7 +170,6 @@ mech_register_deinit(&mech_reg); mech_deinit(global_auth_settings); - auth_penalty_deinit(&auth_penalty); /* allow modules to unregister their dbs/drivers/etc. before freeing the whole data structures containing them. */