From: Timo Sirainen Date: Tue, 12 May 2009 18:04:31 +0000 (-0400) Subject: Fixed using auth worker processes. X-Git-Tag: 2.0.alpha1~786 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9d4033433a797557fc360ba79e328dbd5a876fff;p=thirdparty%2Fdovecot%2Fcore.git Fixed using auth worker processes. --HG-- branch : HEAD --- diff --git a/dovecot-master-example.conf b/dovecot-master-example.conf index 1a6cae0ee2..7e80378200 100644 --- a/dovecot-master-example.conf +++ b/dovecot-master-example.conf @@ -96,10 +96,11 @@ service pop3 { executable = pop3 } -#service auth-worker { -# executable = dovecot-auth -w -# -# unix_listener { -# path = auth-worker -# } -#} +service auth-worker { + executable = dovecot-auth -w + client_limit = 1 + + unix_listener { + path = auth-worker + } +} diff --git a/src/auth/auth-worker-server.c b/src/auth/auth-worker-server.c index 14484d120b..13e472f196 100644 --- a/src/auth/auth-worker-server.c +++ b/src/auth/auth-worker-server.c @@ -48,7 +48,7 @@ static ARRAY_DEFINE(worker_request_array, struct auth_worker_request *); static struct aqueue *worker_request_queue; static time_t auth_worker_last_warn; -static char *worker_socket_path; +static const char *worker_socket_path; static void worker_input(struct auth_worker_connection *conn); static void auth_worker_destroy(struct auth_worker_connection **conn, @@ -337,17 +337,12 @@ void auth_worker_call(struct auth_request *auth_request, void auth_worker_server_init(struct auth *auth) { - const char *env; - if (array_is_created(&connections)) { /* already initialized */ return; } - env = getenv("AUTH_WORKER_PATH"); - if (env == NULL) - i_fatal("AUTH_WORKER_PATH environment not set"); - worker_socket_path = i_strdup(env); + worker_socket_path = "auth-worker"; i_array_init(&worker_request_array, 128); worker_request_queue = aqueue_init(&worker_request_array.arr); @@ -372,5 +367,4 @@ void auth_worker_server_deinit(void) aqueue_deinit(&worker_request_queue); array_free(&worker_request_array); - i_free(worker_socket_path); }