dovecot-2.0: login: Always disconnect clients after 3 minutes if...
dovecot at dovecot.org
dovecot at dovecot.org
Mon Mar 8 19:57:31 EET 2010
details: http://hg.dovecot.org/dovecot-2.0/rev/c56358283605
changeset: 10867:c56358283605
user: Timo Sirainen <tss at iki.fi>
date: Mon Mar 08 19:57:21 2010 +0200
description:
login: Always disconnect clients after 3 minutes if they haven't logged in.
diffstat:
src/login-common/client-common.c | 9 ++++-----
src/login-common/client-common.h | 7 ++++---
2 files changed, 8 insertions(+), 8 deletions(-)
diffs (57 lines):
diff -r 6a2f7843327c -r c56358283605 src/login-common/client-common.c
--- a/src/login-common/client-common.c Mon Mar 08 19:53:28 2010 +0200
+++ b/src/login-common/client-common.c Mon Mar 08 19:57:21 2010 +0200
@@ -71,8 +71,8 @@
DLLIST_PREPEND(&clients, client);
clients_count++;
- client->to_idle_disconnect =
- timeout_add(CLIENT_LOGIN_IDLE_TIMEOUT_MSECS,
+ client->to_disconnect =
+ timeout_add(CLIENT_LOGIN_TIMEOUT_MSECS,
client_idle_disconnect_timeout, client);
client_open_streams(client);
@@ -125,8 +125,8 @@
if (client->io != NULL)
io_remove(&client->io);
- if (client->to_idle_disconnect != NULL)
- timeout_remove(&client->to_idle_disconnect);
+ if (client->to_disconnect != NULL)
+ timeout_remove(&client->to_disconnect);
if (client->to_auth_waiting != NULL)
timeout_remove(&client->to_auth_waiting);
if (client->auth_response != NULL)
@@ -563,7 +563,6 @@
return TRUE;
default:
/* something was read */
- timeout_reset(client->to_idle_disconnect);
return TRUE;
}
}
diff -r 6a2f7843327c -r c56358283605 src/login-common/client-common.h
--- a/src/login-common/client-common.h Mon Mar 08 19:53:28 2010 +0200
+++ b/src/login-common/client-common.h Mon Mar 08 19:57:21 2010 +0200
@@ -15,8 +15,9 @@
SASL authentication gives the largest output. */
#define LOGIN_MAX_OUTBUF_SIZE 4096
-/* Disconnect client after idling this many milliseconds */
-#define CLIENT_LOGIN_IDLE_TIMEOUT_MSECS (3*60*1000)
+/* Disconnect client after this many milliseconds if it hasn't managed
+ to log in yet. */
+#define CLIENT_LOGIN_TIMEOUT_MSECS (3*60*1000)
#define AUTH_SERVER_WAITING_MSG \
"Waiting for authentication process to respond.."
@@ -86,7 +87,7 @@
struct ostream *output;
struct io *io;
struct timeout *to_auth_waiting;
- struct timeout *to_idle_disconnect;
+ struct timeout *to_disconnect;
unsigned char *master_data_prefix;
unsigned int master_data_prefix_len;
More information about the dovecot-cvs
mailing list