stats-connection.c revision 379175cfba8150d481d9898b78330b719d128d84
/* Copyright (c) 2011-2015 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "base64.h"
#include "hostpid.h"
#include "net.h"
#include "str.h"
#include "strescape.h"
#include "master-service.h"
#include "mail-storage.h"
#include "stats.h"
#include "stats-plugin.h"
#include "stats-connection.h"
struct stats_connection {
int refcount;
int fd;
char *path;
bool open_failed;
};
{
if (conn->open_failed)
return FALSE;
return FALSE;
}
return TRUE;
}
struct stats_connection *
stats_connection_create(const char *path)
{
struct stats_connection *conn;
(void)stats_connection_open(conn);
return conn;
}
{
}
{
return;
}
}
{
static bool pipe_warned = FALSE;
/* if master process has been stopped (and restarted), don't even try
to notify the stats process anymore. even if one exists, it doesn't
know about us. */
return;
if (!stats_connection_open(conn))
return;
}
i_warning("stats update sent more bytes that PIPE_BUF "
pipe_warned = TRUE;
}
if (ret < 0) {
/* don't log EPIPE errors. they can happen when
Dovecot is stopped. */
}
}
{
/* required fields */
/* optional fields */
}
}
}
{
}
{
}