master.c revision ecc81625167ed96c04c02aa190a1ea5baa65b474
/* Copyright (C) 2002 Timo Sirainen */
#include "common.h"
#include "ioloop.h"
#include "ostream.h"
#include "network.h"
#include "cookie.h"
#include "master.h"
static AuthCookieReplyData failure_reply;
static unsigned int master_pos;
static char master_buf[sizeof(AuthCookieRequestData)];
int fd __attr_unused__)
{
reply = &failure_reply;
else {
reply = &temp_reply;
else
reply = &failure_reply;
}
case -2:
i_fatal("Master transmit buffer full, aborting");
case -1:
/* master died, kill ourself too */
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_init(void)
{
master_pos = 0;
FALSE);
}
void master_deinit(void)
{
}