summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ec36b4b)
raw | patch | inline | side by side (parent: ec36b4b)
author | Sebastian Harl <sh@tokkee.org> | |
Sun, 14 Oct 2012 14:53:57 +0000 (16:53 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Sun, 14 Oct 2012 14:53:57 +0000 (16:53 +0200) |
Rather, keep the context (i.e. interval) information of the calling (read)
plugin. This allows the write, notify and log callbacks to access the correct
interval settings appropriate for the current data-set.
plugin. This allows the write, notify and log callbacks to access the correct
interval settings appropriate for the current data-set.
src/plugin.c | patch | blob | history |
diff --git a/src/plugin.c b/src/plugin.c
index abb0b1b7d17a6a3fbc2b0ef5709216a17ae82df3..eedbc15af3461906e0d12dbc242d779f1c8d08c3 100644 (file)
--- a/src/plugin.c
+++ b/src/plugin.c
{
callback_func_t *cf = le->value;
plugin_write_cb callback;
- plugin_ctx_t old_ctx = plugin_set_ctx (cf->cf_ctx);
+
+ /* do not switch plugin context; rather keep the context (interval)
+ * information of the calling read plugin */
DEBUG ("plugin: plugin_write: Writing values via %s.", le->key);
callback = cf->cf_callback;
else
success++;
- plugin_set_ctx (old_ctx);
-
le = le->next;
}
{
callback_func_t *cf;
plugin_write_cb callback;
- plugin_ctx_t old_ctx;
le = llist_head (list_write);
while (le != NULL)
cf = le->value;
- old_ctx = plugin_set_ctx (cf->cf_ctx);
+ /* do not switch plugin context; rather keep the context (interval)
+ * information of the calling read plugin */
DEBUG ("plugin: plugin_write: Writing values via %s.", le->key);
callback = cf->cf_callback;
status = (*callback) (ds, vl, &cf->cf_udata);
-
- plugin_set_ctx (old_ctx);
}
return (status);
{
callback_func_t *cf;
plugin_notification_cb callback;
- plugin_ctx_t old_ctx;
int status;
+ /* do not switch plugin context; rather keep the context
+ * (interval) information of the calling plugin */
+
cf = le->value;
- old_ctx = plugin_set_ctx (cf->cf_ctx);
callback = cf->cf_callback;
status = (*callback) (notif, &cf->cf_udata);
- plugin_set_ctx (old_ctx);
if (status != 0)
{
WARNING ("plugin_dispatch_notification: Notification "
{
callback_func_t *cf;
plugin_log_cb callback;
- plugin_ctx_t old_ctx;
cf = le->value;
- old_ctx = plugin_set_ctx (cf->cf_ctx);
callback = cf->cf_callback;
+ /* do not switch plugin context; rather keep the context
+ * (interval) information of the calling plugin */
+
(*callback) (level, msg, &cf->cf_udata);
- plugin_set_ctx (old_ctx);
le = le->next;
}
} /* void plugin_log */