auth-worker-client.c revision 484e12acec34f16e5a8adc001e23ae48f1dda8c7
6509aa7306649042e828fef9e2f280f4535ea137Timo Sirainen/* Copyright (C) 2005 Timo Sirainen */
6509aa7306649042e828fef9e2f280f4535ea137Timo Sirainen/* If no requests have come within this time, kill ourself */
6509aa7306649042e828fef9e2f280f4535ea137Timo Sirainenauth_worker_client_check_throttle(struct auth_worker_client *client)
6509aa7306649042e828fef9e2f280f4535ea137Timo Sirainen if (o_stream_get_buffer_used_size(client->output) >=
6509aa7306649042e828fef9e2f280f4535ea137Timo Sirainen /* stop reading new requests until client has read the pending
6509aa7306649042e828fef9e2f280f4535ea137Timo Sirainenworker_auth_request_new(struct auth_worker_client *client, unsigned int id,
6509aa7306649042e828fef9e2f280f4535ea137Timo Sirainen auth_request = auth_request_new_dummy(client->auth);
6509aa7306649042e828fef9e2f280f4535ea137Timo Sirainen for (tmp = t_strsplit(args, "\t"); *tmp != NULL; tmp++) {
6509aa7306649042e828fef9e2f280f4535ea137Timo Sirainen (void)auth_request_import(auth_request, key, value);
6509aa7306649042e828fef9e2f280f4535ea137Timo Sirainenstatic void add_userdb_replies(string_t *str, const char *data)
6509aa7306649042e828fef9e2f280f4535ea137Timo Sirainen const char *const *tmp;
6509aa7306649042e828fef9e2f280f4535ea137Timo Sirainen for (tmp = t_strsplit(data, "\t"); *tmp != NULL; tmp++)
6509aa7306649042e828fef9e2f280f4535ea137Timo Sirainenstatic void verify_plain_callback(enum passdb_result result,
6509aa7306649042e828fef9e2f280f4535ea137Timo Sirainen struct auth_worker_client *client = request->context;
6509aa7306649042e828fef9e2f280f4535ea137Timo Sirainen if (request->passdb_failure && result == PASSDB_RESULT_OK)
6509aa7306649042e828fef9e2f280f4535ea137Timo Sirainen const char *field =
6509aa7306649042e828fef9e2f280f4535ea137Timo Sirainen auth_stream_reply_export(request->extra_fields);
6509aa7306649042e828fef9e2f280f4535ea137Timo Sirainen const char *data =
6509aa7306649042e828fef9e2f280f4535ea137Timo Sirainen auth_stream_reply_export(request->userdb_reply);
6509aa7306649042e828fef9e2f280f4535ea137Timo Sirainen o_stream_send(client->output, str_data(str), str_len(str));
6509aa7306649042e828fef9e2f280f4535ea137Timo Sirainenauth_worker_handle_passv(struct auth_worker_client *client,
6509aa7306649042e828fef9e2f280f4535ea137Timo Sirainen /* verify plaintext password */
6509aa7306649042e828fef9e2f280f4535ea137Timo Sirainen i_error("BUG: Auth worker server sent us invalid PASSV");
const char *field =
const char *data =
const char *scheme;
unsigned int passdb_id;
args++;
unsigned int passdb_id;
const char *data;
args++;
switch (result) {
case USERDB_RESULT_OK:
unsigned int num;
unsigned int id;
if (p == NULL)
return FALSE;
return TRUE;
char *line;
bool ret;
(int)AUTH_WORKER_MAX_LINE_LENGTH);
t_push();
t_pop();
if (!ret) {
struct auth_worker_client *
FALSE);
return client;