/* If we've been waiting auth server to respond for over this many milliseconds,
send a "waiting" message. */
#define AUTH_WAITING_TIMEOUT_MSECS (30*1000)
+#define GREETING_WARNING_TIMEOUT_MSECS (10*1000)
#define CLIENT_AUTH_BUF_MAX_SIZE 8192
static void client_auth_waiting_timeout(struct client *client)
{
+ if (!client->greeting_sent) {
+ client_log_warn(client, "Auth process not responding, "
+ "delayed sending greeting");
+ }
client_send_line(client, CLIENT_CMD_REPLY_STATUS,
client->master_tag == 0 ?
AUTH_SERVER_WAITING_MSG : AUTH_MASTER_WAITING_MSG);
{
i_assert(client->to_auth_waiting == NULL);
client->to_auth_waiting =
- timeout_add(AUTH_WAITING_TIMEOUT_MSECS,
+ timeout_add(!client->greeting_sent ?
+ GREETING_WARNING_TIMEOUT_MSECS :
+ AUTH_WAITING_TIMEOUT_MSECS,
client_auth_waiting_timeout, client);
}
} T_END;
}
+void client_log_warn(struct client *client, const char *msg)
+{
+ T_BEGIN {
+ i_warning("%s", client_get_log_str(client, msg));
+ } T_END;
+}
+
bool client_is_trusted(struct client *client)
{
const char *const *net;
return "(client didn't send a cert)";
}
+ if (!client->greeting_sent)
+ return t_strdup_printf(
+ "(disconnected before greeting, waited %u secs)",
+ (unsigned int)(ioloop_time - client->created));
+
if (client->auth_attempts == 0) {
return t_strdup_printf("(no auth attempts in %u secs)",
(unsigned int)(ioloop_time - client->created));
void client_set_title(struct client *client);
void client_log(struct client *client, const char *msg);
void client_log_err(struct client *client, const char *msg);
+void client_log_warn(struct client *client, const char *msg);
const char *client_get_extra_disconnect_reason(struct client *client);
bool client_is_trusted(struct client *client);
void client_auth_failed(struct client *client);