dovecot-1.2: Auth worker: Don't die after idling one minute. The...

dovecot at dovecot.org dovecot at dovecot.org
Wed Oct 22 01:24:48 EEST 2008


details:   http://hg.dovecot.org/dovecot-1.2/rev/2792b3a9b67a
changeset: 8311:2792b3a9b67a
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Oct 22 01:24:44 2008 +0300
description:
Auth worker: Don't die after idling one minute. The server process decides when to do it.

diffstat:

1 file changed, 20 deletions(-)
src/auth/auth-worker-client.c |   20 --------------------

diffs (65 lines):

diff -r 2e62e212f8a1 -r 2792b3a9b67a src/auth/auth-worker-client.c
--- a/src/auth/auth-worker-client.c	Wed Oct 22 01:20:12 2008 +0300
+++ b/src/auth/auth-worker-client.c	Wed Oct 22 01:24:44 2008 +0300
@@ -12,9 +12,6 @@
 
 #include <stdlib.h>
 
-/* If no requests have come within this time, kill ourself */
-#define AUTH_WORKER_MAX_IDLE (60*10)
-
 #define OUTBUF_THROTTLE_SIZE (1024*10)
 
 struct auth_worker_client {
@@ -25,9 +22,6 @@ struct auth_worker_client {
 	struct io *io;
 	struct istream *input;
 	struct ostream *output;
-
-	time_t last_request;
-	struct timeout *to;
 };
 
 static void
@@ -448,8 +442,6 @@ static void auth_worker_input(struct aut
 		return;
 	}
 
-	client->last_request = ioloop_time;
-
         client->refcount++;
 	while ((line = i_stream_next_line(client->input)) != NULL) {
 		T_BEGIN {
@@ -478,12 +470,6 @@ static int auth_worker_output(struct aut
 				    auth_worker_input, client);
 	}
 	return 1;
-}
-
-static void auth_worker_client_timeout(struct auth_worker_client *client)
-{
-	if (client->last_request + AUTH_WORKER_MAX_IDLE <= ioloop_time)
-                auth_worker_client_destroy(&client);
 }
 
 struct auth_worker_client *
@@ -501,10 +487,6 @@ auth_worker_client_create(struct auth *a
 	client->output = o_stream_create_fd(fd, (size_t)-1, FALSE);
 	o_stream_set_flush_callback(client->output, auth_worker_output, client);
 	client->io = io_add(fd, IO_READ, auth_worker_input, client);
-
-	client->last_request = ioloop_time;
-	client->to = timeout_add(1000*60, auth_worker_client_timeout, client);
-
 	return client;
 }
 
@@ -515,8 +497,6 @@ void auth_worker_client_destroy(struct a
 	*_client = NULL;
 	if (client->fd == -1)
 		return;
-
-	timeout_remove(&client->to);
 
 	i_stream_close(client->input);
 	o_stream_close(client->output);


More information about the dovecot-cvs mailing list