summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4959697)
raw | patch | inline | side by side (parent: 4959697)
author | Scott Sanders <scott@jssjr.com> | |
Sun, 2 Oct 2011 23:18:06 +0000 (19:18 -0400) | ||
committer | Scott Sanders <scott@jssjr.com> | |
Sun, 2 Oct 2011 23:18:06 +0000 (19:18 -0400) |
This came up during testing with the ntp plugin. The ds_name was being
sent with an ip in the string. This will prevent the result from nesting
in the carbon store.
sent with an ip in the string. This will prevent the result from nesting
in the carbon store.
src/write_graphite.c | patch | blob | history |
diff --git a/src/write_graphite.c b/src/write_graphite.c
index e8bdc65ca0b01febe40326172dfda7254074185c..2d80dbb7bb7baddedc091162cd537bc23d6dfbd0 100644 (file)
--- a/src/write_graphite.c
+++ b/src/write_graphite.c
return (0);
}
-static int normalize_hostname (char *dst, const char *src)
+static int mangle_dots (char *dst, const char *src)
{
size_t i;
const char *prefix, const char *ds_name)
{
int status;
- char *n_hostname;
+ char *n_hostname = 0;
+ char *n_ds_name = 0;
assert (plugin != NULL);
assert (type != NULL);
return (-1);
}
- if (normalize_hostname(n_hostname, hostname) == -1)
+ if (mangle_dots(n_hostname, hostname) == -1)
{
ERROR ("Unable to normalize hostname");
return (-1);
}
+ if (ds_name && ds_name[0] != '\0') {
+ if (mangle_dots(n_ds_name, ds_name) == -1)
+ {
+ ERROR ("Unable to normalize datasource name");
+ return (-1);
+ }
+ }
+
if ((plugin_instance == NULL) || (plugin_instance[0] == '\0'))
{
if ((type_instance == NULL) || (type_instance[0] == '\0'))