view src/auth/auth-master-connection.h @ 3077:eb46a5dee02d HEAD

Changed the way multiple auth processes are handled. It no longer uses a pid appended to socket name but instead there's a balancer process which proxies the requests to worker processes.
author Timo Sirainen <tss@iki.fi>
date Sun, 09 Jan 2005 18:54:48 +0200
parents 3feb38ff17f5
children e6a487d80288
line wrap: on
line source

#ifndef __AUTH_MASTER_CONNECTION_H
#define __AUTH_MASTER_CONNECTION_H

enum listener_type {
	LISTENER_MASTER,
	LISTENER_CLIENT,
	LISTENER_BALANCER
};

struct auth_master_connection {
	struct auth *auth;

	unsigned int pid;
	int refcount;

	int fd;
	struct istream *input;
	struct ostream *output;
	struct io *io;
	buffer_t *listeners_buf;

	struct auth_client_connection *clients;
	struct timeout *to_clients;

	unsigned int version_received:1;
	unsigned int destroyed:1;
};

#define AUTH_MASTER_IS_DUMMY(master) (master->fd == -1)

struct auth_master_connection *
auth_master_connection_create(struct auth *auth, int fd);
void auth_master_connection_send_handshake(struct auth_master_connection *conn);
void auth_master_connection_destroy(struct auth_master_connection *conn);

void auth_master_request_callback(const char *reply, void *context);

void auth_master_connection_add_listener(struct auth_master_connection *conn,
					 int fd, const char *path,
					 enum listener_type type);

#endif