diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-09-19 13:26:44 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-09-19 13:26:44 +0000 |
commit | 64fda257bdaf166ed3d96dce3a01ea14017a2a3e (patch) | |
tree | e33c077dcb46d06755fb4d0b37f829d7f6a0731e /src/statistics | |
parent | 08f1726b6552ac29830637e9f7be4d42e2ea4294 (diff) |
misc minor fixes for new service MQ API, implementing resolver using new service API
Diffstat (limited to 'src/statistics')
-rw-r--r-- | src/statistics/statistics_api.c | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/src/statistics/statistics_api.c b/src/statistics/statistics_api.c index c8709145bb..856873d004 100644 --- a/src/statistics/statistics_api.c +++ b/src/statistics/statistics_api.c @@ -295,12 +295,18 @@ update_memory_statistics (struct GNUNET_STATISTICS_Handle *h) if (current_heap_size > h->peak_heap_size) { h->peak_heap_size = current_heap_size; - GNUNET_STATISTICS_set (h, "# peak heap size", current_heap_size, GNUNET_NO); + GNUNET_STATISTICS_set (h, + "# peak heap size", + current_heap_size, + GNUNET_NO); } if (current_rss > h->peak_rss) { h->peak_rss = current_rss; - GNUNET_STATISTICS_set (h, "# peak resident set size", current_rss, GNUNET_NO); + GNUNET_STATISTICS_set (h, + "# peak resident set size", + current_rss, + GNUNET_NO); } #endif } @@ -739,7 +745,8 @@ reconnect_later (struct GNUNET_STATISTICS_Handle *h) */ loss = GNUNET_NO; for (gh = h->action_head; NULL != gh; gh = gh->next) - if ( (gh->make_persistent) && (ACTION_SET == gh->type) ) + if ( (gh->make_persistent) && + (ACTION_SET == gh->type) ) loss = GNUNET_YES; if (GNUNET_YES == loss) GNUNET_log (GNUNET_ERROR_TYPE_WARNING, @@ -922,8 +929,7 @@ GNUNET_STATISTICS_destroy (struct GNUNET_STATISTICS_Handle *h, GNUNET_assert (GNUNET_NO == h->do_destroy); /* Don't call twice. */ if ( (sync_first) && (NULL != h->mq) && - (0 != GNUNET_MQ_get_length (h->mq)) && - (GNUNET_YES == try_connect (h)) ) + (0 != GNUNET_MQ_get_length (h->mq)) ) { if ( (NULL != h->current) && (ACTION_GET == h->current->type) ) @@ -933,8 +939,7 @@ GNUNET_STATISTICS_destroy (struct GNUNET_STATISTICS_Handle *h, { next = pos->next; if ( (ACTION_GET == pos->type) || - (ACTION_WATCH == pos->type) || - (GNUNET_NO == pos->make_persistent) ) + (ACTION_WATCH == pos->type) ) { GNUNET_CONTAINER_DLL_remove (h->action_head, h->action_tail, @@ -1009,7 +1014,7 @@ schedule_action (void *cls) reconnect_later (h); return; } - if (0 < GNUNET_MQ_get_length (h->mq) ) + if (0 < GNUNET_MQ_get_length (h->mq)) return; /* Wait for queue to be reduced more */ /* schedule next action */ while (NULL == h->current) @@ -1200,8 +1205,10 @@ GNUNET_STATISTICS_watch_cancel (struct GNUNET_STATISTICS_Handle *handle, continue; if ( (w->proc == proc) && (w->proc_cls == proc_cls) && - (0 == strcmp (w->name, name)) && - (0 == strcmp (w->subsystem, subsystem)) ) + (0 == strcmp (w->name, + name)) && + (0 == strcmp (w->subsystem, + subsystem)) ) { GNUNET_free (w->name); GNUNET_free (w->subsystem); @@ -1291,8 +1298,10 @@ add_setter_action (struct GNUNET_STATISTICS_Handle *h, ai->type = type; } } - ai->timeout = GNUNET_TIME_relative_to_absolute (SET_TRANSMIT_TIMEOUT); - ai->make_persistent = make_persistent; + ai->timeout + = GNUNET_TIME_relative_to_absolute (SET_TRANSMIT_TIMEOUT); + ai->make_persistent + = make_persistent; return; } /* no existing entry matches, create a fresh one */ |