master-connection.c revision 007d354a674fb3ddf49db160cf050cf61270a1a0
/* Copyright (C) 2002 Timo Sirainen */
#include "common.h"
#include "buffer.h"
#include "hash.h"
#include "ioloop.h"
#include "ostream.h"
#include "network.h"
#include "mech.h"
#include "userdb.h"
#include "login-connection.h"
#include "master-connection.h"
#include "auth-master-interface.h"
static struct auth_master_reply failure_reply;
static unsigned int master_pos;
static char master_buf[sizeof(struct auth_master_request)];
{
return (size_t)-1;
return index;
}
static struct auth_master_reply *
{
char *p;
if (p == NULL) {
} else {
/* wu-ftpd like <chroot>/./<home> */
}
return reply_p;
}
unsigned int tag)
{
for (;;) {
if (ret < 0) {
/* master died, kill ourself too */
break;
}
break;
/* buffer full, we have to block */
i_warning("Master transmit buffer full, blocking..");
if (o_stream_flush(output) < 0) {
/* transmit error, probably master died */
break;
}
}
}
{
struct auth_master_reply *reply;
else {
}
}
{
struct login_connection *login_conn;
struct auth_request *auth_request;
if (auth_request == NULL) {
if (verbose) {
i_info("Master request %u.%u not found",
}
} else {
}
}
{
int ret;
sizeof(master_buf) - master_pos);
if (ret < 0) {
/* master died, kill ourself too */
return;
}
master_pos += ret;
if (master_pos < sizeof(master_buf))
return;
/* reply is now read */
master_pos = 0;
}
void master_connection_init(void)
{
master_pos = 0;
/* just a note to master that we're ok. if we die before,
master should shutdown itself. */
}
void master_connection_deinit(void)
{
}