master-connection.c revision 7013075e208bc7aa87257df7d9664c84c7c220f3
/* 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 *
{
struct auth_master_reply *reply;
return reply;
}
int fd __attr_unused__)
{
struct login_connection *login_conn;
struct auth_request *auth_request;
struct auth_master_reply *reply;
reply_size = sizeof(*reply);
reply = &failure_reply;
else {
reply = &failure_reply;
else
}
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;
}
}
}
{
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;
FALSE);
/* just a note to master that we're ok. if we die before,
master should shutdown itself. */
}
void master_connection_deinit(void)
{
}