/* Copyright (c) 2009-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "ioloop.h"
#include "net.h"
#include "istream.h"
#include "ostream.h"
#include "array.h"
#include "aqueue.h"
#include "anvil-client.h"
struct anvil_query {
void *context;
};
struct anvil_client {
char *path;
int fd;
bool (*reconnect_callback)(void);
};
struct anvil_client *
enum anvil_client_flags flags)
{
return client;
}
{
}
{
if (!client->reconnect_callback()) {
/* no reconnection */
return;
}
}
}
} else {
}
}
{
const char *line;
unsigned int count;
continue;
}
} T_END;
}
else
}
}
{
int fd;
if (fd == -1) {
i_error("net_connect_unix(%s) failed: %m",
}
return -1;
}
return -1;
}
return 0;
}
{
unsigned int count;
}
}
{
}
}
{
i_error("%s: Anvil queries timed out after %u secs - aborting queries",
/* perhaps reconnect helps */
}
{
return -1;
}
return -1;
}
return 0;
}
struct anvil_query *
{
/* connection failure. add a delayed failure callback.
the caller may not expect the callback to be called
immediately. */
}
return anvil_query;
}
struct anvil_query **_query)
{
unsigned int i, count;
for (i = 0; i < count; i++) {
return;
}
}
i_panic("anvil query to be aborted doesn't exist");
}
{
}
{
}