void client_destroy(struct imap_client *client, const char *reason)
{
+ if (client->destroyed)
+ return;
+ client->destroyed = TRUE;
+
if (reason != NULL)
client_syslog(client, reason);
hash_remove(clients, client);
imap_parser_destroy(client->parser);
+ client->parser = NULL;
+
i_stream_close(client->input);
o_stream_close(client->output);
client->common.fd = -1;
}
- i_free(client->common.virtual_user);
client_unref(client);
}
o_stream_unref(client->output);
buffer_free(client->plain_login);
+ i_free(client->common.virtual_user);
i_free(client);
main_unref();
unsigned int tls:1;
unsigned int cmd_finished:1;
unsigned int skip_line:1;
+ unsigned int destroyed:1;
};
struct client *client_create(int fd, struct ip_addr *ip, int ssl);
void client_destroy(struct pop3_client *client, const char *reason)
{
+ if (client->destroyed)
+ return;
+ client->destroyed = TRUE;
+
if (reason != NULL)
client_syslog(client, reason);
net_disconnect(client->common.fd);
client->common.fd = -1;
- i_free(client->common.virtual_user);
client_unref(client);
}
o_stream_unref(client->output);
buffer_free(client->plain_login);
+ i_free(client->common.virtual_user);
i_free(client);
main_unref();
buffer_t *plain_login;
unsigned int tls:1;
+ unsigned int destroyed:1;
};
struct client *client_create(int fd, struct ip_addr *ip, int ssl);