dsync-proxy-server.c revision 7692e292b02b35dd11cbfb9e79bc9a6209e72968
/* Copyright (c) 2009-2011 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "strescape.h"
#include "fd-set-nonblock.h"
#include "istream.h"
#include "ostream.h"
#include "master-service.h"
#include "dsync-worker.h"
#include "dsync-proxy.h"
#include "dsync-proxy-server.h"
#include <stdlib.h>
static int
const char **line_r)
{
i_error("read() from proxy client failed: %m");
return -1;
}
i_error("read() from proxy client failed: EOF");
return -1;
}
}
return 0;
if (!server->handshake_received) {
return -1;
}
}
return 1;
}
{
int ret;
return 0;
if (ret < 0) {
return -1;
}
return 1;
}
static int
{
const char *const *args;
const char **cmd_args;
unsigned int i, count;
return -1;
}
return -1;
} else {
args++;
for (i = 0; i < count; i++) {
args[i]));
}
return proxy_server_run_cmd(server);
}
}
{
const char *line;
int ret = 0;
/* wait until command handling is finished */
return;
}
T_BEGIN {
} T_END;
if (ret <= 0)
break;
}
ret = -1;
if (ret < 0)
}
{
int ret;
ret = 1;
(void)proxy_server_run_cmd(server);
}
/* handle pending input */
}
}
return ret;
}
{
i_error("proxy server timed out");
}
struct dsync_proxy_server *
{
struct dsync_proxy_server *server;
server);
return server;
}
{
i_error("close(proxy input) failed: %m");
i_error("close(proxy output) failed: %m");
}
}