summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8ccce39)
raw | patch | inline | side by side (parent: 8ccce39)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Tue, 21 Dec 2010 16:50:16 +0000 (16:50 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Tue, 21 Dec 2010 16:50:16 +0000 (16:50 +0000) |
#define. Renamed CMD_MAX to RRD_CMD_MAX and put into rrd_client.h
so that it is available to clients as well. -- kevin brintnall
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@2156 a5681a0c-68f1-0310-ab6d-d61299d08faa
so that it is available to clients as well. -- kevin brintnall
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@2156 a5681a0c-68f1-0310-ab6d-d61299d08faa
program/src/rrd_client.c | patch | blob | history | |
program/src/rrd_client.h | patch | blob | history | |
program/src/rrd_daemon.c | patch | blob | history |
index 870a27b72fcf631912d05537da87a8557d8d941f..29d1d29989ea3066d201fcbdc037b978637cac47 100644 (file)
--- a/program/src/rrd_client.c
+++ b/program/src/rrd_client.c
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;
index e203d7ca9748f43d7602ad4f0a0d58c13fcfb726..681397dd571480b2087a09e64da7b802392edb93 100644 (file)
--- a/program/src/rrd_client.h
+++ b/program/src/rrd_client.h
typedef unsigned long long int uint64_t;
#endif
+/* max length of socket command or response */
+#define RRD_CMD_MAX 4096
#ifndef RRDCACHED_DEFAULT_ADDRESS
# define RRDCACHED_DEFAULT_ADDRESS "unix:/tmp/rrdcached.sock"
index a2001359e158bb1e92852d53369163f2fc571f41..79fbc310e13836c4f9d3268f4290361cc7a6b5e1 100644 (file)
--- a/program/src/rrd_daemon.c
+++ b/program/src/rrd_daemon.c
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;