return i < size ? 1 : 0;
}
-void client_auth_parse_response(struct client *client)
+bool client_auth_parse_response(struct client *client)
{
if (client_auth_read_line(client) <= 0)
- return;
-
- client_auth_respond(client, str_c(client->auth_response));
- memset(str_c_modifiable(client->auth_response), 0,
- str_len(client->auth_response));
+ return FALSE;
+ return TRUE;
}
static void client_auth_input(struct client *client)
{
i_assert(client->v.auth_parse_response != NULL);
- client->v.auth_parse_response(client);
+ if (!client->v.auth_parse_response(client))
+ return;
+
+ client_auth_respond(client, str_c(client->auth_response));
+ memset(str_c_modifiable(client->auth_response), 0,
+ str_len(client->auth_response));
}
void client_auth_send_challenge(struct client *client, const char *data)
struct auth_mech_desc *mech);
bool (*sasl_check_login)(struct client *client);
void (*auth_send_challenge)(struct client *client, const char *data);
- void (*auth_parse_response)(struct client *client);
+ bool (*auth_parse_response)(struct client *client);
void (*auth_result)(struct client *client,
enum client_auth_result result,
const struct client_auth_reply *reply,
void client_set_auth_waiting(struct client *client);
void client_auth_send_challenge(struct client *client, const char *data);
-void client_auth_parse_response(struct client *client);
+bool client_auth_parse_response(struct client *client);
int client_auth_begin(struct client *client, const char *mech_name,
const char *init_resp);
int client_auth_begin_private(struct client *client, const char *mech_name,