Skip to content
Snippets Groups Projects
Commit bae10a75 authored by Timo Sirainen's avatar Timo Sirainen Committed by aki.tuomi
Browse files

managesieve: Move finishing istream to client_create_finish()

parent 953daba7
No related branches found
No related tags found
No related merge requests found
...@@ -172,6 +172,7 @@ client_create_from_input(const struct mail_storage_service_input *input, ...@@ -172,6 +172,7 @@ client_create_from_input(const struct mail_storage_service_input *input,
client = client_create(fd_in, fd_out, input->session_id, client = client_create(fd_in, fd_out, input->session_id,
event, mail_user, user, set); event, mail_user, user, set);
client_create_finish(client);
T_BEGIN { T_BEGIN {
client_add_input(client, input_buf); client_add_input(client, input_buf);
} T_END; } T_END;
......
...@@ -154,7 +154,6 @@ client_create(int fd_in, int fd_out, const char *session_id, ...@@ -154,7 +154,6 @@ client_create(int fd_in, int fd_out, const char *session_id,
o_stream_set_flush_callback(client->output, client_output, client); o_stream_set_flush_callback(client->output, client_output, client);
client->io = io_add_istream(client->input, client_input, client);
client->last_input = ioloop_time; client->last_input = ioloop_time;
client->to_idle = timeout_add(CLIENT_IDLE_TIMEOUT_MSECS, client->to_idle = timeout_add(CLIENT_IDLE_TIMEOUT_MSECS,
client_idle_timeout, client); client_idle_timeout, client);
...@@ -165,14 +164,6 @@ client_create(int fd_in, int fd_out, const char *session_id, ...@@ -165,14 +164,6 @@ client_create(int fd_in, int fd_out, const char *session_id,
client->cmd.event = event_create(client->event); client->cmd.event = event_create(client->event);
client->user = user; client->user = user;
if (set->rawlog_dir[0] != '\0') {
(void)iostream_rawlog_create(set->rawlog_dir, &client->input,
&client->output);
}
client->parser = managesieve_parser_create(
client->input, set->managesieve_max_line_length);
client->svinst = svinst; client->svinst = svinst;
client->storage = storage; client->storage = storage;
...@@ -194,6 +185,17 @@ client_create(int fd_in, int fd_out, const char *session_id, ...@@ -194,6 +185,17 @@ client_create(int fd_in, int fd_out, const char *session_id,
return client; return client;
} }
void client_create_finish(struct client *client)
{
if (client->set->rawlog_dir[0] != '\0') {
(void)iostream_rawlog_create(client->set->rawlog_dir,
&client->input, &client->output);
}
client->parser = managesieve_parser_create(
client->input, client->set->managesieve_max_line_length);
client->io = io_add_istream(client->input, client_input, client);
}
static const char *client_stats(struct client *client) static const char *client_stats(struct client *client)
{ {
const struct var_expand_table logout_tab[] = { const struct var_expand_table logout_tab[] = {
......
...@@ -91,6 +91,7 @@ client_create(int fd_in, int fd_out, const char *session_id, ...@@ -91,6 +91,7 @@ client_create(int fd_in, int fd_out, const char *session_id,
struct event *event, struct mail_user *user, struct event *event, struct mail_user *user,
struct mail_storage_service_user *service_user, struct mail_storage_service_user *service_user,
const struct managesieve_settings *set); const struct managesieve_settings *set);
void client_create_finish(struct client *client);
void client_destroy(struct client *client, const char *reason); void client_destroy(struct client *client, const char *reason);
void client_dump_capability(struct client *client); void client_dump_capability(struct client *client);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment

Consent

On this website, we use the web analytics service Matomo to analyze and review the use of our website. Through the collected statistics, we can improve our offerings and make them more appealing for you. Here, you can decide whether to allow us to process your data and set corresponding cookies for these purposes, in addition to technically necessary cookies. Further information on data protection—especially regarding "cookies" and "Matomo"—can be found in our privacy policy. You can withdraw your consent at any time.