dovecot-2.2: auth: Log a nicer message if client timeouts authen...

dovecot at dovecot.org dovecot at dovecot.org
Mon Oct 29 17:55:55 EET 2012


details:   http://hg.dovecot.org/dovecot-2.2/rev/49bb6cc43d03
changeset: 15328:49bb6cc43d03
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Oct 22 18:59:20 2012 +0300
description:
auth: Log a nicer message if client timeouts authentication in the middle.

diffstat:

 src/auth/auth-request-handler.c |  13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diffs (29 lines):

diff -r 09ed39c15584 -r 49bb6cc43d03 src/auth/auth-request-handler.c
--- a/src/auth/auth-request-handler.c	Mon Oct 22 18:35:56 2012 +0300
+++ b/src/auth/auth-request-handler.c	Mon Oct 22 18:59:20 2012 +0300
@@ -401,19 +401,18 @@
 
 static void auth_request_timeout(struct auth_request *request)
 {
-	const char *str;
+	unsigned int secs = (unsigned int)(time(NULL) - request->last_access);
 
-	str = t_strdup_printf("Request %u.%u timeouted after %u secs, state=%d",
-			      request->handler->client_pid, request->id,
-			      (unsigned int)(time(NULL) - request->last_access),
-			      request->state);
 	if (request->state != AUTH_REQUEST_STATE_MECH_CONTINUE) {
 		/* client's fault */
 		auth_request_log_error(request, request->mech->mech_name,
-				       "%s", str);
+			"Request %u.%u timed out after %u secs, state=%d",
+			request->handler->client_pid, request->id,
+			secs, request->state);
 	} else if (request->set->verbose) {
 		auth_request_log_info(request, request->mech->mech_name,
-				      "%s", str);
+			"Request timed out waiting for client to continue authentication "
+			"(%u secs)", secs);
 	}
 	auth_request_handler_remove(request->handler, request);
 }


More information about the dovecot-cvs mailing list