static int buffer_add_value (const char *value, /* {{{ */
char **buffer_ret, size_t *buffer_size_ret)
{
- char temp[4096];
+ char temp[RRD_CMD_MAX];
if (strncmp (value, "N:", 2) == 0)
snprintf (temp, sizeof (temp), "%lu:%s",
static int buffer_add_ulong (const unsigned long value, /* {{{ */
char **buffer_ret, size_t *buffer_size_ret)
{
- char temp[4096];
+ char temp[RRD_CMD_MAX];
snprintf (temp, sizeof (temp), "%lu", value);
temp[sizeof (temp) - 1] = 0;
rrdc_response_t *ret = NULL;
int status = 0;
- char buffer[4096];
+ char buffer[RRD_CMD_MAX];
char *buffer_ptr;
size_t i;
int rrdc_update (const char *filename, int values_num, /* {{{ */
const char * const *values)
{
- char buffer[4096];
+ char buffer[RRD_CMD_MAX];
char *buffer_ptr;
size_t buffer_free;
size_t buffer_size;
int rrdc_flush (const char *filename) /* {{{ */
{
- char buffer[4096];
+ char buffer[RRD_CMD_MAX];
char *buffer_ptr;
size_t buffer_free;
size_t buffer_size;
rrd_info_t * rrdc_info (const char *filename) /* {{{ */
{
- char buffer[4096];
+ char buffer[RRD_CMD_MAX];
char *buffer_ptr;
size_t buffer_free;
size_t buffer_size;
time_t rrdc_last (const char *filename) /* {{{ */
{
- char buffer[4096];
+ char buffer[RRD_CMD_MAX];
char *buffer_ptr;
size_t buffer_free;
size_t buffer_size;
time_t rrdc_first (const char *filename, int rraindex) /* {{{ */
{
- char buffer[4096];
+ char buffer[RRD_CMD_MAX];
char *buffer_ptr;
size_t buffer_free;
size_t buffer_size;
int argc,
const char **argv)
{
- char buffer[4096];
+ char buffer[RRD_CMD_MAX];
char *buffer_ptr;
size_t buffer_free;
size_t buffer_size;
char ***ret_ds_names,
rrd_value_t **ret_data)
{
- char buffer[4096];
+ char buffer[RRD_CMD_MAX];
char *buffer_ptr;
size_t buffer_free;
size_t buffer_size;
size_t files_num;
} journal_set;
-/* max length of socket command or response */
-#define CMD_MAX 4096
-#define RBUF_SIZE (CMD_MAX*2)
+#define RBUF_SIZE (RRD_CMD_MAX*2)
/*
* Variables
static int add_response_info(listen_socket_t *sock, char *fmt, ...) /* {{{ */
{
va_list argp;
- char buffer[CMD_MAX];
+ char buffer[RRD_CMD_MAX];
int len;
if (JOURNAL_REPLAY(sock)) return 0;
char *fmt, ...) /* {{{ */
{
va_list argp;
- char buffer[CMD_MAX];
+ char buffer[RRD_CMD_MAX];
int lines;
ssize_t wrote;
int rclen, len;
char *file, file_tmp[PATH_MAX];
int values_num = 0;
int status;
- char orig_buf[CMD_MAX];
+ char orig_buf[RRD_CMD_MAX];
cache_item_t *ci;
if (help && (help->syntax || help->help))
{
- char tmp[CMD_MAX];
+ char tmp[RRD_CMD_MAX];
snprintf(tmp, sizeof(tmp)-1, "Help for %s\n", help->cmd);
resp_txt = tmp;
int entry_cnt = 0;
int fail_cnt = 0;
uint64_t line = 0;
- char entry[CMD_MAX];
+ char entry[RRD_CMD_MAX];
time_t now;
if (file == NULL) return 0;