diff src/login-common/client-common.c @ 8583:2ff2cac3578b HEAD

imap/pop3-login: Cleaned up proxying code. Don't disconnect client on proxy failures. Log proxy failures as errors.
author Timo Sirainen <tss@iki.fi>
date Sun, 21 Dec 2008 09:43:20 +0200
parents 983d38de06c9
children b9faf4db2a9f
line wrap: on
line diff
--- a/src/login-common/client-common.c	Fri Dec 19 18:08:09 2008 +0200
+++ b/src/login-common/client-common.c	Sun Dec 21 09:43:20 2008 +0200
@@ -109,7 +109,8 @@
 	return FALSE;
 }
 
-static void client_syslog_real(struct client *client, const char *msg)
+static const char *
+client_get_log_str(struct client *client, const char *msg)
 {
 	static struct var_expand_table static_tab[3] = {
 		{ 's', NULL, NULL },
@@ -147,13 +148,20 @@
 	str_truncate(str, 0);
 
 	var_expand(str, log_format, tab);
-	i_info("%s", str_c(str));
+	return str_c(str);
 }
 
 void client_syslog(struct client *client, const char *msg)
 {
 	T_BEGIN {
-		client_syslog_real(client, msg);
+		i_info("%s", client_get_log_str(client, msg));
+	} T_END;
+}
+
+void client_syslog_err(struct client *client, const char *msg)
+{
+	T_BEGIN {
+		i_error("%s", client_get_log_str(client, msg));
 	} T_END;
 }