/* Copyright (c) 2011-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "aqueue.h"
#include "ioloop.h"
#include "istream.h"
#include "ostream.h"
#include "str.h"
#include "strescape.h"
#include "master-service.h"
#include "indexer-queue.h"
#include "worker-connection.h"
#include <unistd.h>
#define INDEXER_PROTOCOL_MINOR_VERSION 0
struct worker_connection {
int refcount;
char *socket_path;
int fd;
char *request_username;
unsigned int process_limit;
};
struct worker_connection *
{
return conn;
}
{
return;
}
{
}
/* cancel any pending requests */
if (count > 0) {
i_error("Indexer worker disconnected, "
"discarding %u requests for %s",
}
/* conn->callback() can try to destroy us */
for (i = 0; i < count; i++) {
void *const *contextp =
}
}
{
}
static int
{
int percentage;
return -1;
}
return -1;
}
/* the request is finished */
}
return 0;
}
{
const char *line;
return;
}
if (!conn->version_received) {
return;
i_error("Indexer worker not compatible with this master "
"(mixed old and new binaries?)");
return;
}
}
if (conn->process_limit == 0) {
return;
conn->process_limit == 0) {
i_error("Indexer worker sent invalid handshake: %s",
line);
return;
}
}
break;
}
}
}
{
return -1;
}
return 0;
}
{
}
unsigned int *limit_r)
{
if (conn->process_limit == 0)
return FALSE;
return TRUE;
}
const struct indexer_request *request,
void *context)
{
else {
}
T_BEGIN {
} T_END;
}
{
}
{
return conn->request_username;
}