From: Timo Sirainen Date: Thu, 8 Jan 2009 16:41:30 +0000 (-0500) Subject: auth worker processes shouldn't duplicate the auth cache. X-Git-Tag: 1.2.beta1~144 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=952f450ce320c226e9dbb50b980dc8c0f9679bf4;p=thirdparty%2Fdovecot%2Fcore.git auth worker processes shouldn't duplicate the auth cache. --HG-- branch : HEAD --- diff --git a/src/auth/auth-request.c b/src/auth/auth-request.c index 5bdf60d5c7..758e6233cc 100644 --- a/src/auth/auth-request.c +++ b/src/auth/auth-request.c @@ -1055,9 +1055,11 @@ void auth_request_set_field(struct auth_request *request, return; } - if (passdb_cache != NULL && - request->passdb->passdb->cache_key != NULL) { - /* we'll need to get this field stored into cache */ + if ((passdb_cache != NULL && + request->passdb->passdb->cache_key != NULL) || worker) { + /* we'll need to get this field stored into cache, + or we're a worker and we'll need to send this to the main + auth process that can store it in the cache. */ if (request->extra_cache_fields == NULL) { request->extra_cache_fields = auth_stream_reply_init(request->pool); diff --git a/src/auth/auth.c b/src/auth/auth.c index d437b2aa7e..2a0e2ed9d0 100644 --- a/src/auth/auth.c +++ b/src/auth/auth.c @@ -199,7 +199,9 @@ void auth_init(struct auth *auth) passdb_init(passdb); for (userdb = auth->userdbs; userdb != NULL; userdb = userdb->next) userdb_init(userdb); - passdb_cache_init(); + /* caching is handled only by the main auth process */ + if (!worker) + passdb_cache_init(); auth->mech_handshake = str_new(auth->pool, 512);