From: Stephan Bosch Date: Fri, 2 Nov 2018 23:37:52 +0000 (+0100) Subject: lmtp: DATA command: Put the data input stream in the client state rather than the... X-Git-Tag: 2.3.7~181 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c9c53a766151f662d02b84215628fe13538c6b25;p=thirdparty%2Fdovecot%2Fcore.git lmtp: DATA command: Put the data input stream in the client state rather than the transaction context. --- diff --git a/src/lmtp/client.h b/src/lmtp/client.h index e74be37642..845b8a6d8b 100644 --- a/src/lmtp/client.h +++ b/src/lmtp/client.h @@ -12,6 +12,8 @@ struct client_state { const char *name; unsigned int session_id_seq; + struct istream *data_input; + struct timeval data_end_timeval; struct ostream *mail_data_output; diff --git a/src/lmtp/commands.c b/src/lmtp/commands.c index dad5b8adec..61cbbd39c8 100644 --- a/src/lmtp/commands.c +++ b/src/lmtp/commands.c @@ -155,7 +155,7 @@ int cmd_data_continue(void *conn_ctx, struct smtp_server_cmd_ctx *cmd, { struct client *client = (struct client *)conn_ctx; struct client_state *state = &client->state; - struct istream *data_input = (struct istream *)trans->context; + struct istream *data_input = state->data_input; const unsigned char *data; size_t size; ssize_t ret; @@ -193,7 +193,7 @@ int cmd_data_continue(void *conn_ctx, struct smtp_server_cmd_ctx *cmd, int cmd_data_begin(void *conn_ctx, struct smtp_server_cmd_ctx *cmd ATTR_UNUSED, - struct smtp_server_transaction *trans, + struct smtp_server_transaction *trans ATTR_UNUSED, struct istream *data_input) { struct client *client = (struct client *)conn_ctx; @@ -206,6 +206,6 @@ int cmd_data_begin(void *conn_ctx, client->state.mail_data_output = iostream_temp_create_named(str_c(path), 0, "(lmtp data)"); - trans->context = (void*)data_input; + client->state.data_input = data_input; return 0; }