/* Copyright (c) 2011-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "ioloop.h"
#include "time-util.h"
#include "stats-settings.h"
#include "mail-stats.h"
#include "istream.h"
#include "ostream.h"
#include "net.h"
#include "str.h"
#include "write-full.h"
#include "stats-carbon.h"
struct stats_send_ctx {
int fd;
unsigned long to_msecs;
const char *endpoint;
const char *str;
void (*callback)(void *);
void *ctx;
};
void
{
}
static void
{
}
static void
{
i_error("Stats submit(%s) failed: endpoint timeout after %lu msecs",
}
static void
{
i_error("connect(%s) failed: %m",
return;
}
i_error("write(%s) failed: %m",
}
int
struct stats_send_ctx **ctx_r)
{
const char *host;
i_error("stats_submit: Cannot parse endpoint '%s'",
endpoint);
return -1;
}
struct stats_send_ctx, 1);
return -1;
}
ctx);
/* give time for almost until next update
this is to ensure we leave a little pause between
attempts. Multiplier 800 gives us 20% window, and
ensures the number stays positive. */
ctx);
i_unreached();
return 0;
}