From: Timo Sirainen Date: Wed, 23 Nov 2011 18:31:40 +0000 (+0200) Subject: lib-auth: Log a warning about auth disconnection only if there are pending requests. X-Git-Tag: 2.1.rc1~24 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=742b9a0fc1d5513552fe99aa726497d1250d762e;p=thirdparty%2Fdovecot%2Fcore.git lib-auth: Log a warning about auth disconnection only if there are pending requests. --- diff --git a/src/lib-auth/auth-server-connection.c b/src/lib-auth/auth-server-connection.c index 4fbd1751fb..b3b669b2e1 100644 --- a/src/lib-auth/auth-server-connection.c +++ b/src/lib-auth/auth-server-connection.c @@ -243,7 +243,6 @@ static void auth_server_connection_input(struct auth_server_connection *conn) return; case -1: /* disconnected */ - i_error("Authentication server disconnected, reconnecting"); auth_server_connection_reconnect(conn); return; case -2: @@ -309,7 +308,13 @@ auth_server_connection_remove_requests(struct auth_server_connection *conn) static const char *const temp_failure_args[] = { "temp", NULL }; struct hash_iterate_context *iter; void *key, *value; + unsigned int request_count = hash_table_count(conn->requests); + if (request_count == 0) + return; + + i_warning("Auth connection closed with %u pending requests", + request_count); iter = hash_table_iterate_init(conn->requests); while (hash_table_iterate(iter, &key, &value)) { struct auth_client_request *request = value; @@ -378,6 +383,7 @@ void auth_server_connection_deinit(struct auth_server_connection **_conn) *_conn = NULL; auth_server_connection_disconnect(conn); + i_assert(hash_table_count(conn->requests) == 0); hash_table_destroy(&conn->requests); array_free(&conn->available_auth_mechs); pool_unref(&conn->pool);