bool sending, sent, done;
};
+struct auth_worker_client *auth_worker_client;
+
static void auth_worker_input(struct auth_worker_client *client);
static int auth_worker_output(struct auth_worker_client *client);
client->output = o_stream_create_fd(fd, (size_t)-1, FALSE);
o_stream_set_flush_callback(client->output, auth_worker_output, client);
client->io = io_add(fd, IO_READ, auth_worker_input, client);
+
+ auth_worker_client = client;
return client;
}
client->fd = -1;
auth_worker_client_unref(&client);
+ auth_worker_client = NULL;
master_service_client_connection_destroyed(master_service);
}
#define AUTH_WORKER_MAX_LINE_LENGTH 8192
+extern struct auth_worker_client *auth_worker_client;
+
struct auth_worker_client *auth_worker_client_create(struct auth *auth, int fd);
void auth_worker_client_destroy(struct auth_worker_client **client);
void auth_worker_client_unref(struct auth_worker_client **client);
static struct module *modules = NULL;
static struct auth *auth;
-static struct auth_worker_client *worker_client;
static ARRAY_DEFINE(listen_fd_types, enum auth_socket_type);
static void main_preinit(struct auth_settings *set)
static void main_deinit(void)
{
- if (worker_client != NULL)
- auth_worker_client_destroy(&worker_client);
+ if (auth_worker_client != NULL)
+ auth_worker_client_destroy(&auth_worker_client);
else
auth_request_handler_flush_failures(TRUE);
static void worker_connected(const struct master_service_connection *conn)
{
- if (worker_client != NULL) {
+ if (auth_worker_client != NULL) {
i_error("Auth workers can handle only a single client");
(void)close(conn->fd);
return;
}
- worker_client = auth_worker_client_create(auth, conn->fd);
+ (void)auth_worker_client_create(auth, conn->fd);
}
static void client_connected(const struct master_service_connection *conn)