ipc-server.c revision bcb4e51a409d94ae670de96afb8483a4f7855294
/* Copyright (c) 2011-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "ioloop.h"
#include "net.h"
#include "istream.h"
#include "ostream.h"
#include "hostpid.h"
#include "master-service.h"
#include "ipc-server.h"
#include <unistd.h>
#define IPC_SERVER_PROTOCOL_MAJOR_VERSION 1
#define IPC_SERVER_PROTOCOL_MINOR_VERSION 0
#define IPC_SERVER_HANDSHAKE "VERSION\tipc-server\t1\t0\nHANDSHAKE\t%s\t%s\n"
struct ipc_cmd {
struct ipc_server *server;
unsigned int tag;
};
struct ipc_server {
int ipc_cmd_refcount;
int fd;
bool version_received:1;
};
{
unsigned int tag = 0;
char *p;
/* tag cmd */
if (p != NULL) {
*p++ = '\0';
p = NULL;
}
if (p == NULL || *p == '\0') {
return;
}
T_BEGIN {
} T_END;
}
{
char *line;
return;
}
if (!server->version_received) {
return;
i_error("IPC proxy not compatible with this server "
"(mixed old and new binaries?)");
return;
}
}
}
{
return;
}
}
{
return;
}
struct ipc_server *
{
struct ipc_server *server;
return server;
}
{
}
{
}
{
}
{
}
{
}
{
}