]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lmtp: DATA command: Put the data input stream in the client state rather than the...
authorStephan Bosch <stephan.bosch@dovecot.fi>
Fri, 2 Nov 2018 23:37:52 +0000 (00:37 +0100)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Tue, 25 Jun 2019 11:19:16 +0000 (11:19 +0000)
src/lmtp/client.h
src/lmtp/commands.c

index e74be37642267392c6942fc9fdddadb1520e37a1..845b8a6d8b3a6f1ac6691501f9a07f040b5c9bfd 100644 (file)
@@ -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;
index dad5b8adec8f21363d472b958e6bee49e142f81c..61cbbd39c804a4cfda71cd1fa804b3354a1deb59 100644 (file)
@@ -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;
 }