]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Auth worker: Don't die after idling one minute. The server process decides when to...
authorTimo Sirainen <tss@iki.fi>
Tue, 21 Oct 2008 22:24:44 +0000 (01:24 +0300)
committerTimo Sirainen <tss@iki.fi>
Tue, 21 Oct 2008 22:24:44 +0000 (01:24 +0300)
--HG--
branch : HEAD

src/auth/auth-worker-client.c

index 89cf0b28da304d6a3d0f9f7460e1c9cb56179f14..3d4fb029b3a5cee8694e78771e11c3af9ff2a6a7 100644 (file)
@@ -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 auth_worker_client *client)
                return;
        }
 
-       client->last_request = ioloop_time;
-
         client->refcount++;
        while ((line = i_stream_next_line(client->input)) != NULL) {
                T_BEGIN {
@@ -480,12 +472,6 @@ static int auth_worker_output(struct auth_worker_client *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 *
 auth_worker_client_create(struct auth *auth, int fd)
 {
@@ -501,10 +487,6 @@ auth_worker_client_create(struct auth *auth, int fd)
        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;
 }
 
@@ -516,8 +498,6 @@ void auth_worker_client_destroy(struct auth_worker_client **_client)
        if (client->fd == -1)
                return;
 
-       timeout_remove(&client->to);
-
        i_stream_close(client->input);
        o_stream_close(client->output);