io_remove(&client->io);
- client->io = io_add(client->fd, IO_READ, client_input, client);
- client_input(client);
+ if (!client_does_custom_io(client)) {
+ client->io = io_add(client->fd, IO_READ, client_input, client);
+ client_input(client);
+ }
}
static void client_auth_waiting_timeout(struct client *client)
client->auth_waiting = FALSE;
client_set_auth_waiting(client);
auth_client_request_continue(client->auth_request, response);
- io_remove(&client->io);
+ if (!client_does_custom_io(client))
+ io_remove(&client->io);
}
void client_auth_abort(struct client *client)
i_assert(client->io == NULL);
client->auth_waiting = TRUE;
- client->io = io_add(client->fd, IO_READ,
- client_auth_input, client);
- client_auth_input(client);
+ if (!client_does_custom_io(client)) {
+ client->io = io_add(client->fd, IO_READ,
+ client_auth_input, client);
+ client_auth_input(client);
+ }
return;
}
client_notify_auth_ready(client);
- if (client->input_blocked) {
+ if (!client_does_custom_io(client) && client->input_blocked) {
client->input_blocked = FALSE;
client_input(client);
}
if (client->starttls) {
io_remove(&client->io);
- client->io = io_add_istream(client->input, client_input, client);
+ if (!client_does_custom_io(client)) {
+ client->io = io_add_istream(client->input,
+ client_input, client);
+ }
}
return 0;
}
void client_input(struct client *client)
{
+ i_assert(client->v.input != NULL);
client->v.input(client);
}
const char *client_get_session_id(struct client *client);
bool client_read(struct client *client);
+
void client_input(struct client *client);
+static inline bool
+client_does_custom_io(struct client *client)
+{
+ return (client->v.input == NULL);
+}
+
void client_notify_auth_ready(struct client *client);
void client_notify_status(struct client *client, bool bad, const char *text);
void client_notify_disconnect(struct client *client,