struct director_user_iter *user_iter;
/* set during command execution */
- const char *cur_cmd, *cur_line;
+ const char *cur_cmd, *const *cur_args;
bool in:1;
bool connected:1;
va_start(args, fmt);
i_error("director(%s): Command %s: %s (input: %s)", conn->name,
- conn->cur_cmd, t_strdup_vprintf(fmt, args), conn->cur_line);
+ conn->cur_cmd, t_strdup_vprintf(fmt, args),
+ t_strarray_join(conn->cur_args, "\t"));
va_end(args);
if (conn->host != NULL)
static bool
director_connection_handle_line(struct director_connection *conn,
- const char *line)
+ char *line)
{
const char *cmd, *const *args;
bool ret;
dir_debug("input: %s: %s", conn->name, line);
- args = t_strsplit_tabescaped(line);
- cmd = args[0]; args++;
+ args = t_strsplit_tabescaped_inplace(line);
+ cmd = args[0];
if (cmd == NULL) {
director_cmd_error(conn, "Received empty line");
return FALSE;
}
conn->cur_cmd = cmd;
- conn->cur_line = line;
- ret = director_connection_handle_cmd(conn, cmd, args);
+ conn->cur_args = args;
+ ret = director_connection_handle_cmd(conn, cmd, args+1);
conn->cur_cmd = NULL;
- conn->cur_line = NULL;
+ conn->cur_args = NULL;
return ret;
}