#include "imap-commands.h"
#include "istream.h"
#include "ostream.h"
-#include "ostream-multiplex.h"
#include "iostream-rawlog.h"
#include "str.h"
#include "strescape.h"
/* Let imap-login process handle the COMPRESS. It's the one
that will send the tagged reply to the client. */
client->compress_handler = handler;
- if (client->side_channel_output == NULL) {
- client->side_channel_output =
- o_stream_multiplex_add_channel(
- client->multiplex_output, 1);
- o_stream_set_no_error_handling(
- client->side_channel_output, TRUE);
- }
+ if (client->side_channel_output == NULL)
+ client_create_side_channel_output(client);
string_t *str = t_str_new(64);
str_append(str, "compress\t");
str_append_tabescaped(str, handler->name);
cmd->client->v.send_tagline(cmd, data);
}
+void client_create_side_channel_output(struct client *client)
+{
+ i_assert(client->multiplex_output != NULL);
+ i_assert(client->side_channel_output == NULL);
+ client->side_channel_output =
+ o_stream_multiplex_add_channel(client->multiplex_output, 1);
+ o_stream_set_no_error_handling(client->side_channel_output, TRUE);
+}
+
static void
client_default_send_tagline(struct client_command_context *cmd, const char *data)
{
const unsigned char *data, size_t size);
void client_destroy(struct client *client, const char *reason) ATTR_NULL(2);
+/* Add the side-channel ostream used to send commands (e.g. dict_reset) back
+ to the imap-login proxy. Must only be called when multiplex_output is set
+ and the channel hasn't been created yet. */
+void client_create_side_channel_output(struct client *client);
+
/* Disconnect client connection */
void client_disconnect(struct client *client, const char *reason);
void client_disconnect_with_error(struct client *client,