]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth worker processes shouldn't duplicate the auth cache.
authorTimo Sirainen <tss@iki.fi>
Thu, 8 Jan 2009 16:41:30 +0000 (11:41 -0500)
committerTimo Sirainen <tss@iki.fi>
Thu, 8 Jan 2009 16:41:30 +0000 (11:41 -0500)
--HG--
branch : HEAD

src/auth/auth-request.c
src/auth/auth.c

index 5bdf60d5c7eacf4f444df1e1edec5012810e56d1..758e6233ccb6cb64c92200ce2c167299ba7621e5 100644 (file)
@@ -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);
index d437b2aa7e24f4d15b3b8623f4932f80a88e2e99..2a0e2ed9d016ab1e733bf9b00d94b3bd6b1e5b98 100644 (file)
@@ -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);