imap_urlauth_client_auth_result,
NULL,
NULL,
- NULL
+ NULL,
+ NULL,
};
static const struct login_binary imap_urlauth_login_binary = {
client->v.proxy_error(client, text);
}
+const char *client_proxy_get_state(struct client *client)
+{
+ if (client->v.proxy_get_state == NULL)
+ return dec2str(client->proxy_state);
+ else
+ return client->v.proxy_get_state(client);
+}
+
void client_proxy_log_failure(struct client *client, const char *line)
{
string_t *str = t_str_new(128);
duration = ioloop_time - client->created;
client_log_err(client, t_strdup_printf(
"proxy: Remote %s:%u disconnected: %s "
- "(state=%u, duration=%us)%s",
+ "(state=%s, duration=%us)%s",
login_proxy_get_host(client->login_proxy),
login_proxy_get_port(client->login_proxy),
io_stream_get_disconnect_reason(input, NULL),
- client->proxy_state, duration,
+ client_proxy_get_state(client), duration,
line == NULL ? "" : t_strdup_printf(
" - BUG: line not read: %s", line)));
client_proxy_failed(client, TRUE);
user_reason = "Timeout while finishing login.";
destroy_reason = t_strdup_printf(
"proxy: Logging in to %s:%u timed out "
- "(state=%u, duration=%us)",
+ "(state=%s, duration=%us)",
login_proxy_get_host(client->login_proxy),
login_proxy_get_port(client->login_proxy),
- client->proxy_state, secs);
+ client_proxy_get_state(client), secs);
client_log_err(client, destroy_reason);
} else {
user_reason = "Disconnected for inactivity.";
void (*proxy_reset)(struct client *client);
int (*proxy_parse_line)(struct client *client, const char *line);
void (*proxy_error)(struct client *client, const char *text);
+ const char *(*proxy_get_state)(struct client *client);
};
struct client {
void client_proxy_finish_destroy_client(struct client *client);
void client_proxy_log_failure(struct client *client, const char *line);
void client_proxy_failed(struct client *client, bool send_line);
+const char *client_proxy_get_state(struct client *client);
void clients_notify_auth_connected(void);
void client_destroy_oldest(void);
str_printfa(str, "connect(%s, %u) failed: %m",
proxy->host, proxy->port);
} else {
- str_printfa(str, "Login for %s:%u timed out in state=%u",
+ str_printfa(str, "Login for %s:%u timed out in state=%s",
proxy->host, proxy->port,
- proxy->client->proxy_state);
+ client_proxy_get_state(proxy->client));
}
str_printfa(str, " (after %u secs",
(unsigned int)(ioloop_time - proxy->created.tv_sec));
pop3_client_auth_result,
pop3_proxy_reset,
pop3_proxy_parse_line,
- pop3_proxy_error
+ pop3_proxy_error,
+ NULL,
};
static const struct login_binary pop3_login_binary = {