login_refresh_proctitle();
}
-void client_destroy(struct client *client, const char *reason)
+void client_disconnect(struct client *client, const char *reason)
{
- i_assert(client->create_finished);
-
- if (client->destroyed)
+ if (client->disconnected)
return;
- client->destroyed = TRUE;
-
- pool_unref(&client->preproxy_pool);
+ client->disconnected = TRUE;
if (!client->login_success &&
!client->no_extra_disconnect_reason && reason != NULL) {
if (reason != NULL)
client_log(client, reason);
- if (last_client == client)
- last_client = client->prev;
- DLLIST_REMOVE(&clients, client);
-
if (client->output != NULL)
o_stream_uncork(client->output);
if (!client->login_success) {
client_fd_proxies_count++;
}
}
+}
+
+void client_destroy(struct client *client, const char *reason)
+{
+ i_assert(client->create_finished);
+
+ if (client->destroyed)
+ return;
+ client->destroyed = TRUE;
+
+ client_disconnect(client, reason);
+
+ pool_unref(&client->preproxy_pool);
+
+ if (last_client == client)
+ last_client = client->prev;
+ DLLIST_REMOVE(&clients, client);
if (client->master_tag != 0) {
i_assert(client->auth_request == NULL);
unsigned int director_username_hash_cache;
bool create_finished:1;
+ bool disconnected:1;
bool destroyed:1;
bool input_blocked:1;
bool login_success:1;
const struct login_settings *set,
const struct master_service_ssl_settings *ssl_set);
void client_init(struct client *client, void **other_sets);
+void client_disconnect(struct client *client, const char *reason);
void client_destroy(struct client *client, const char *reason);
/* Destroy the client after a successful login. Either the client fd was
sent to the post-login process, or the connection will be proxied. */