client-common.c revision 2e37d45867d081db150ab78dad303b9077aea24f
c25356d5978632df6203437e1953bcb29e0c736fTimo Sirainen/* Copyright (c) 2002-2011 Dovecot authors, see the included COPYING file */
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainenstruct client *clients = NULL, *last_client = NULL;
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainenstatic unsigned int clients_count = 0;
7d6389e4053c2dac1fb37180b5756b00785983dcTimo Sirainenstatic void client_idle_disconnect_timeout(struct client *client)
b44650b0f48a4b5f0dc240ed836833a00b643b9fTimo Sirainen client_send_line(client, CLIENT_CMD_REPLY_BYE,
b44650b0f48a4b5f0dc240ed836833a00b643b9fTimo Sirainen "Disconnected for inactivity.");
7d6389e4053c2dac1fb37180b5756b00785983dcTimo Sirainen client_destroy(client, "Disconnected: Inactivity");
22535a9e685e29214082878e37a267157044618eTimo Sirainenstatic void client_open_streams(struct client *client)
b321df9603081896b70ec44635af96d674a9839aTimo Sirainen i_stream_create_fd(client->fd, LOGIN_MAX_INBUF_SIZE, FALSE);
f3d506e525a720f214020ca0f989a1966b30edaeTimo Sirainen o_stream_create_fd(client->fd, LOGIN_MAX_OUTBUF_SIZE, FALSE);
7d6389e4053c2dac1fb37180b5756b00785983dcTimo Sirainen const struct login_settings *set, void **other_sets,
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainen const struct ip_addr *local_ip, const struct ip_addr *remote_ip)
adea1e1e46ccb4ae107767fd930e3d1fb4f1d11dTimo Sirainen client->v.auth_send_challenge = client_auth_send_challenge;
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainen client->v.auth_parse_response = client_auth_parse_response;
b44650b0f48a4b5f0dc240ed836833a00b643b9fTimo Sirainenvoid client_destroy(struct client *client, const char *reason)
473080c7c0d25ddfdf77e7dfa0ba8f73c6c669d5Timo Sirainen if (!client->login_success && reason != NULL) {
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainen client_get_extra_disconnect_reason(client), NULL);
return TRUE;
return FALSE;
void client_destroy_oldest(void)
void clients_destroy_all(void)
int fd_ssl;
int ret;
if (ret > 0) {
if (!ssl_initialized) {
unsigned int clients_get_count(void)
return clients_count;
static const struct var_expand_table *
const char *ssl_state =
const char *ssl_error =
return tab;
char key;
return FALSE;
T_BEGIN {
} T_END;
T_BEGIN {
} T_END;
const char *const *net;
unsigned int bits;
return FALSE;
return TRUE;
return FALSE;
const char *text)
return FALSE;
return FALSE;
return TRUE;
return TRUE;