static bool client_handle_input(struct imap_client *client)
{
- const struct imap_arg *args;
- bool parsed;
- int ret;
-
i_assert(!client->common.authenticating);
if (client->cmd_finished) {
if (client->cmd_name == NULL)
return FALSE; /* need more data */
}
+ return client->common.v.input_next_cmd(&client->common);
+}
+
+static bool imap_client_input_next_cmd(struct client *_client)
+{
+ struct imap_client *client = (struct imap_client *)_client;
+ const struct imap_arg *args;
+ bool parsed;
+ int ret;
if (strcasecmp(client->cmd_name, "AUTHENTICATE") == 0) {
/* SASL-IR may need more space than input buffer's size,
imap_proxy_error,
imap_proxy_get_state,
client_common_send_raw_data,
+ imap_client_input_next_cmd,
};
static const struct login_binary imap_login_binary = {
NULL,
NULL,
client_common_send_raw_data,
+ NULL,
};
static const struct login_binary imap_urlauth_login_binary = {
const char *(*proxy_get_state)(struct client *client);
void (*send_raw_data)(struct client *client,
const void *data, size_t size);
+ bool (*input_next_cmd)(struct client *client);
};
struct client {
/* Disconnect client when it sends too many bad commands */
#define CLIENT_MAX_BAD_COMMANDS 3
-static bool pop3_client_input_next_cmd(struct client *client);
-
static bool cmd_stls(struct pop3_client *client)
{
client_cmd_starttls(&client->common);
commands until the authentication is finished. */
while (!client->output->closed && !client->authenticating &&
auth_client_is_connected(auth_client)) {
- if (!pop3_client_input_next_cmd(client))
+ if (!client->v.input_next_cmd(client))
break;
}
pop3_proxy_error,
pop3_proxy_get_state,
client_common_send_raw_data,
+ pop3_client_input_next_cmd,
};
static const struct login_binary pop3_login_binary = {