/* Copyright (c) 2013-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "ioloop.h"
#include "net.h"
#include "istream.h"
#include "ostream.h"
#include "buffer.h"
#include "hash.h"
#include "llist.h"
#include "strescape.h"
#include "replicator-connection.h"
struct replicator_connection {
char *path;
int fd;
unsigned int request_id_counter;
};
static int
{
void *context;
unsigned int id;
/* <+|-> \t <id> */
return -1;
}
return -1;
}
return 0;
}
{
const char *line;
case -2:
/* buffer full */
i_error("Replicator sent too long line");
return;
case -1:
/* disconnected */
return;
}
}
static bool
{
/* try to send about IO_BLOCK_SIZE amount of data,
but only full lines */
for (;; len++) {
len++;
break;
}
}
return FALSE;
}
return TRUE;
}
{
enum replication_priority p;
return 1;
}
for (p = REPLICATION_PRIORITY_SYNC;;) {
break;
}
/* output buffer is empty, send more data */
break;
} else {
if (p == REPLICATION_PRIORITY_LOW)
break;
p--;
}
}
return 1;
}
{
unsigned int n;
return;
if (fd == -1)
} else {
if (fd != -1)
break;
i_error("connect(%s, %u) failed: %m",
}
}
if (fd == -1) {
conn);
}
return;
}
}
{
}
{
return;
}
{
unsigned int i;
for (i = REPLICATION_PRIORITY_LOW; i <= REPLICATION_PRIORITY_SYNC; i++)
return conn;
}
struct replicator_connection *
{
return conn;
}
struct replicator_connection *
{
return conn;
}
{
unsigned int i;
for (i = REPLICATION_PRIORITY_LOW; i <= REPLICATION_PRIORITY_SYNC; i++)
}
static void
{
/* we can send data immediately */
/* FIXME: compress duplicates, start writing to file */
} else {
/* queue internally to separate queues */
}
}
const char *username,
enum replication_priority priority)
{
switch (priority) {
i_unreached();
case REPLICATION_PRIORITY_LOW:
priority_str = "low";
break;
priority_str = "high";
break;
}
T_BEGIN {
} T_END;
}
{
unsigned int id;
T_BEGIN {
} T_END;
}