projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
contrib/collection3: Add basic compatibility to mod_perl.
[collectd.git]
/
src
/
utils_cmd_getval.c
diff --git
a/src/utils_cmd_getval.c
b/src/utils_cmd_getval.c
index
33b40e0
..
ce3e28e
100644
(file)
--- a/
src/utils_cmd_getval.c
+++ b/
src/utils_cmd_getval.c
@@
-51,7
+51,7
@@
int handle_getval (FILE *fh, char *buffer)
const data_set_t *ds;
int status;
const data_set_t *ds;
int status;
-
int
i;
+
size_t
i;
if ((fh == NULL) || (buffer == NULL))
return (-1);
if ((fh == NULL) || (buffer == NULL))
return (-1);
@@
-83,6
+83,12
@@
int handle_getval (FILE *fh, char *buffer)
}
assert (identifier != NULL);
}
assert (identifier != NULL);
+ if (*buffer != 0)
+ {
+ print_to_socket (fh, "-1 Garbage after end of command: %s\n", buffer);
+ return (-1);
+ }
+
/* parse_identifier() modifies its first argument,
* returning pointers into it */
identifier_copy = sstrdup (identifier);
/* parse_identifier() modifies its first argument,
* returning pointers into it */
identifier_copy = sstrdup (identifier);
@@
-92,7
+98,7
@@
int handle_getval (FILE *fh, char *buffer)
&type, &type_instance);
if (status != 0)
{
&type, &type_instance);
if (status != 0)
{
- DEBUG ("
unixsock plugin
: Cannot parse identifier `%s'.", identifier);
+ DEBUG ("
handle_getval
: Cannot parse identifier `%s'.", identifier);
print_to_socket (fh, "-1 Cannot parse identifier `%s'.\n", identifier);
sfree (identifier_copy);
return (-1);
print_to_socket (fh, "-1 Cannot parse identifier `%s'.\n", identifier);
sfree (identifier_copy);
return (-1);
@@
-101,7
+107,7
@@
int handle_getval (FILE *fh, char *buffer)
ds = plugin_get_ds (type);
if (ds == NULL)
{
ds = plugin_get_ds (type);
if (ds == NULL)
{
- DEBUG ("
unixsock plugin
: plugin_get_ds (%s) == NULL;", type);
+ DEBUG ("
handle_getval
: plugin_get_ds (%s) == NULL;", type);
print_to_socket (fh, "-1 Type `%s' is unknown.\n", type);
sfree (identifier_copy);
return (-1);
print_to_socket (fh, "-1 Type `%s' is unknown.\n", type);
sfree (identifier_copy);
return (-1);
@@
-117,7
+123,7
@@
int handle_getval (FILE *fh, char *buffer)
return (-1);
}
return (-1);
}
- if (ds->ds_num != values_num)
+ if (
(size_t)
ds->ds_num != values_num)
{
ERROR ("ds[%s]->ds_num = %i, "
"but uc_get_rate_by_name returned %u values.",
{
ERROR ("ds[%s]->ds_num = %i, "
"but uc_get_rate_by_name returned %u values.",