/* Copyright (c) 2011-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "ioloop.h"
#include "str.h"
#include "master-service.h"
#include "stats-connection.h"
#include <unistd.h>
#include <fcntl.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 *
{
(void)stats_connection_open(conn);
return conn;
}
{
}
{
return;
}
{
/* 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 -1;
if (!stats_connection_open(conn))
return -1;
}
i_warning("stats update sent more bytes that PIPE_BUF "
pipe_warned = TRUE;
}
/* success */
return 0;
/* stats process is busy */
}
return -1;
} else {
/* error - reconnect */
if (ret < 0) {
/* don't log EPIPE errors. they can happen when
Dovecot is stopped. */
return -1;
}
}