summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 896261a)
raw | patch | inline | side by side (parent: 896261a)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sat, 12 Jun 2010 10:15:36 +0000 (12:15 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sat, 12 Jun 2010 10:15:36 +0000 (12:15 +0200) |
src/varnish.c | patch | blob | history |
diff --git a/src/varnish.c b/src/varnish.c
index 940854200b83ba4e4c58c641bb7751fcb5ea0ceb..33c57ec9040170dfc95e4645442b9d5d26e4abce 100644 (file)
--- a/src/varnish.c
+++ b/src/varnish.c
sfree (conf);
} /* }}} */
+static int varnish_config_apply_default (user_config_t *conf) /* {{{ */
+{
+ if (conf == NULL)
+ return (EINVAL);
+
+ conf->collect_cache = 1;
+ conf->collect_backend = 1;
+ conf->collect_connections = 1;
+ conf->collect_shm = 1;
+
+ return (0);
+} /* }}} int varnish_config_apply_default */
+
static int varnish_init (void) /* {{{ */
{
user_config_t *conf;
/* Default settings: */
conf->instance = NULL;
- conf->collect_cache = 1;
- conf->collect_backend = 1;
- conf->collect_connections = 1;
- conf->collect_shm = 1;
+
+ varnish_config_apply_default (conf);
ud.data = conf;
ud.free_func = varnish_config_free;
&& !conf->collect_sm
&& !conf->collect_totals)
{
- WARNING ("Varnish plugin: No metric has been configured for "
- "instance \"%s\". Disabling this instance.",
- (conf->instance == NULL) ? "localhost" : conf->instance);
- return (EINVAL);
+ varnish_config_apply_default (conf);
}
ssnprintf (callback_name, sizeof (callback_name), "varnish/%s",