From: hno <> Date: Tue, 16 Jul 2002 04:13:27 +0000 (+0000) Subject: Free the authenticate cache on shutdown. This fixes the error where X-Git-Tag: SQUID_3_0_PRE1~899 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c623f072faf16d8f637b526820c0a9092ff11825;p=thirdparty%2Fsquid.git Free the authenticate cache on shutdown. This fixes the error where mempools complains about destroying a pool with items inuse when shutting down the Basic auth scheme. Does not affect Squid-2.5 as memPoolDestroy() isn't as picky there and happily destroys the pool even if there is items in use. --- diff --git a/src/authenticate.cc b/src/authenticate.cc index 05eb0faea0..09a2aa79c2 100644 --- a/src/authenticate.cc +++ b/src/authenticate.cc @@ -1,6 +1,6 @@ /* - * $Id: authenticate.cc,v 1.38 2002/06/12 11:47:59 robertc Exp $ + * $Id: authenticate.cc,v 1.39 2002/07/15 22:13:27 hno Exp $ * * DEBUG: section 29 Authenticator * AUTHOR: Duane Wessels @@ -654,11 +654,28 @@ authenticateInit(authConfig * config) authenticateInitUserCache(); } +static void +authenticateProxyUserCacheFree(void *usernamehash_p) +{ + auth_user_hash_pointer *usernamehash = usernamehash_p; + auth_user_t *auth_user; + char *username = NULL; + auth_user = usernamehash->auth_user; + username = authenticateUserUsername(auth_user); + if ((authenticateAuthUserInuse(auth_user) - 1)) + debug(29, 1) ("authenticateProxyUserCacheFree: entry in use\n"); + authenticateAuthUserUnlock(auth_user); +} + void authenticateShutdown(void) { int i; debug(29, 2) ("authenticateShutdown: shutting down auth schemes\n"); + /* free the cache if we are shutting down */ + if (shutting_down) + hashFreeItems(proxy_auth_username_cache, authenticateProxyUserCacheFree); + /* find the currently known authscheme types */ for (i = 0; authscheme_list && authscheme_list[i].typestr; i++) { if (authscheme_list[i].donefunc != NULL)