Mercurial > dovecot > core-2.2
changeset 19964:dd0b73d89761
login-proxy: When logging failures, include the client info prefix.
author | Timo Sirainen <timo.sirainen@dovecot.fi> |
---|---|
date | Tue, 29 Mar 2016 12:15:05 +0300 |
parents | bd9c9196a439 |
children | 9c7f7098fdaf |
files | src/login-common/client-common-auth.c src/login-common/login-proxy.c |
diffstat | 2 files changed, 13 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/src/login-common/client-common-auth.c Tue Mar 29 11:28:55 2016 +0300 +++ b/src/login-common/client-common-auth.c Tue Mar 29 12:15:05 2016 +0300 @@ -206,7 +206,7 @@ str_printfa(str, " (master %s)", client->proxy_master_user); str_append(str, ": "); str_append(str, line); - i_info("%s", str_c(str)); + client_log(client, str_c(str)); } void client_proxy_failed(struct client *client, bool send_line)
--- a/src/login-common/login-proxy.c Tue Mar 29 11:28:55 2016 +0300 +++ b/src/login-common/login-proxy.c Tue Mar 29 12:15:05 2016 +0300 @@ -295,7 +295,7 @@ } str_append_c(str, ')'); - i_error("%s", str_c(str)); + client_log_err(proxy->client, str_c(str)); } static void proxy_reconnect_timeout(struct login_proxy *proxy) @@ -376,8 +376,9 @@ rec->last_failure.tv_sec - rec->last_success.tv_sec > PROXY_IMMEDIATE_FAILURE_SECS && rec->num_waiting_connections != 0) { /* the server is down. fail immediately */ - i_error("proxy(%s): Host %s:%u is down", - proxy->client->virtual_user, proxy->host, proxy->port); + client_log_err(proxy->client, t_strdup_printf( + "proxy(%s): Host %s:%u is down", + proxy->client->virtual_user, proxy->host, proxy->port)); login_proxy_free(&proxy); return -1; } @@ -412,13 +413,15 @@ i_assert(client->login_proxy == NULL); if (set->host == NULL || *set->host == '\0') { - i_error("proxy(%s): host not given", client->virtual_user); + client_log_err(client, t_strdup_printf( + "proxy(%s): host not given", client->virtual_user)); return -1; } if (client->proxy_ttl <= 1) { - i_error("proxy(%s): TTL reached zero - " - "proxies appear to be looping?", client->virtual_user); + client_log_err(client, t_strdup_printf( + "proxy(%s): TTL reached zero - " + "proxies appear to be looping?", client->virtual_user)); return -1; } @@ -440,9 +443,10 @@ if (set->ip.family == 0 && net_addr2ip(set->host, &proxy->ip) < 0) { - i_error("proxy(%s): BUG: host %s is not an IP " + client_log_err(client, t_strdup_printf( + "proxy(%s): BUG: host %s is not an IP " "(auth should have changed it)", - client->virtual_user, set->host); + client->virtual_user, set->host)); } else { if (login_proxy_connect(proxy) < 0) return -1;