summaryrefslogtreecommitdiff
path: root/plugin/business/doh/src/doh.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/business/doh/src/doh.cpp')
-rw-r--r--plugin/business/doh/src/doh.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/plugin/business/doh/src/doh.cpp b/plugin/business/doh/src/doh.cpp
index a8d32e8..49f8ad5 100644
--- a/plugin/business/doh/src/doh.cpp
+++ b/plugin/business/doh/src/doh.cpp
@@ -391,11 +391,10 @@ static void doh_maat_scan(const struct tfe_stream *stream, const struct tfe_http
static void doh_gc_cb(evutil_socket_t fd, short what, void *arg)
{
- int i = 0;
-
- for (i = 0; i < DOH_STAT_MAX; i++)
+ for (int i = 0; i < DOH_STAT_MAX; i++)
{
- FS_operate(g_doh_conf->fs_handle, g_doh_conf->fs_id[i], 0, FS_OP_SET, ATOMIC_READ(&(g_doh_conf->stat_val[i])));
+ long long delta = ATOMIC_EXCHANGE(&(g_doh_conf->stat_val[i]), 0);
+ fieldstat_easy_counter_incrby(g_doh_conf->fs_handle, 0, g_doh_conf->fs_id[i], NULL, 0, delta);
}
}
@@ -413,7 +412,7 @@ static int doh_field_init()
{
if (spec[i] != NULL)
{
- g_doh_conf->fs_id[i] = FS_register(g_doh_conf->fs_handle, FS_STYLE_FIELD, FS_CALC_CURRENT, spec[i]);
+ g_doh_conf->fs_id[i] = fieldstat_easy_register_counter(g_doh_conf->fs_handle, spec[i]);
}
}
g_doh_conf->gcev = event_new(g_doh_conf->gc_evbase, -1, EV_PERSIST, doh_gc_cb, NULL);