main.c revision 5a250816ffc4cc5db203f9410ea99b6601c7b91a
76b43e4417bab52e913da39b5f5bc2a130d3f149Timo Sirainen/* Copyright (c) 2002-2011 Dovecot authors, see the included COPYING file */
55a7410569737197afb302b07b488973324b0cc5Timo Sirainen#define AUTH_CLIENT_IDLE_TIMEOUT_MSECS (1000*60)
63946971b08cfb1eec698c28569e1c4aa237852dTimo Sirainenconst struct login_settings *global_login_settings;
a04cd96888653891272a512f7735121193af7b35Timo Sirainenstatic void login_access_lookup_next(struct login_access_lookup *lookup);
55a7410569737197afb302b07b488973324b0cc5Timo Sirainen if (!global_login_settings->verbose_proctitle)
a04cd96888653891272a512f7735121193af7b35Timo Sirainen } else if (clients_get_count() > 1 || client == NULL) {
55a7410569737197afb302b07b488973324b0cc5Timo Sirainen process_title_set(t_strdup_printf("[%u connections (%u TLS)]",
a04cd96888653891272a512f7735121193af7b35Timo Sirainen } else if ((addr = net_ip2addr(&client->ip)) != NULL) {
a04cd96888653891272a512f7735121193af7b35Timo Sirainen process_title_set(t_strdup_printf(client->tls ?
a04cd96888653891272a512f7735121193af7b35Timo Sirainen process_title_set(client->tls ? "[TLS]" : "");
a04cd96888653891272a512f7735121193af7b35Timo Sirainenstatic void auth_client_idle_timeout(struct auth_client *auth_client)
55a7410569737197afb302b07b488973324b0cc5Timo Sirainen if (clients == NULL && auth_client_to == NULL) {
a04cd96888653891272a512f7735121193af7b35Timo Sirainen auth_client_to = timeout_add(AUTH_CLIENT_IDLE_TIMEOUT_MSECS,
6ef7e31619edfaa17ed044b45861d106a86191efTimo Sirainenstatic void login_die(void)
55a7410569737197afb302b07b488973324b0cc5Timo Sirainen /* we don't have auth client, and we might never get one */
55a7410569737197afb302b07b488973324b0cc5Timo Sirainenclient_connected_finish(const struct master_service_connection *conn)
55a7410569737197afb302b07b488973324b0cc5Timo Sirainen if (net_getsockname(conn->fd, &local_ip, &local_port) < 0) {
55a7410569737197afb302b07b488973324b0cc5Timo Sirainen pool = pool_alloconly_create("login client", 5*1024);
55a7410569737197afb302b07b488973324b0cc5Timo Sirainen client = client_create(conn->fd, FALSE, pool, set, other_sets,
e60a349c641bb2f4723e4a395a25f55531682d2bTimo Sirainen fd_ssl = ssl_proxy_alloc(conn->fd, &conn->remote_ip, set,
55a7410569737197afb302b07b488973324b0cc5Timo Sirainen master_service_client_connection_destroyed(master_service);
97cfe59cd16ce624e58e8d9b6003d1e29d75b3d2Timo Sirainen client = client_create(fd_ssl, TRUE, pool, set, other_sets,
if (!success) {
int ret;
if (ret <= 0) {
const char *access_sockets =
if (connected)
else if (shutting_down)
static bool anvil_reconnect_callback(void)
return FALSE;
unsigned int max_fds;
random_init();
if (allow_core_dumps)
FALSE);
static void main_deinit(void)
return FATAL_DEFAULT;
main_deinit();