aboutsummaryrefslogtreecommitdiff
path: root/src/statistics
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-10-06 20:55:28 +0000
committerChristian Grothoff <christian@grothoff.org>2013-10-06 20:55:28 +0000
commit61c39c60565b386e0e12ea669556b030e8cd7180 (patch)
tree59109aeab8297bdc996faca8c4e38ec7426c36cf /src/statistics
parent780eb09dd8040ecf8649d40ddf8314464e0fc48e (diff)
downloadgnunet-61c39c60565b386e0e12ea669556b030e8cd7180.tar.gz
gnunet-61c39c60565b386e0e12ea669556b030e8cd7180.zip
-remove trailing whitespace
Diffstat (limited to 'src/statistics')
-rw-r--r--src/statistics/gnunet-service-statistics.c6
-rw-r--r--src/statistics/gnunet-statistics.c14
-rw-r--r--src/statistics/statistics_api.c44
-rw-r--r--src/statistics/test_statistics_api.c4
-rw-r--r--src/statistics/test_statistics_api_loop.c2
-rw-r--r--src/statistics/test_statistics_api_watch.c4
6 files changed, 37 insertions, 37 deletions
diff --git a/src/statistics/gnunet-service-statistics.c b/src/statistics/gnunet-service-statistics.c
index 737ecd7a3..acf2a965f 100644
--- a/src/statistics/gnunet-service-statistics.c
+++ b/src/statistics/gnunet-service-statistics.c
@@ -291,7 +291,7 @@ save ()
291 struct StatsEntry *pos; 291 struct StatsEntry *pos;
292 char *fn; 292 char *fn;
293 struct GNUNET_BIO_WriteHandle *wh; 293 struct GNUNET_BIO_WriteHandle *wh;
294 294
295 uint16_t size; 295 uint16_t size;
296 unsigned long long total; 296 unsigned long long total;
297 297
@@ -716,7 +716,7 @@ handle_watch (void *cls, struct GNUNET_SERVER_Client *client,
716/** 716/**
717 * Actually perform the shutdown. 717 * Actually perform the shutdown.
718 */ 718 */
719static void 719static void
720do_shutdown () 720do_shutdown ()
721{ 721{
722 struct WatchEntry *we; 722 struct WatchEntry *we;
@@ -726,7 +726,7 @@ do_shutdown ()
726 return; 726 return;
727 save (); 727 save ();
728 GNUNET_SERVER_notification_context_destroy (nc); 728 GNUNET_SERVER_notification_context_destroy (nc);
729 nc = NULL; 729 nc = NULL;
730 GNUNET_assert (NULL == client_head); 730 GNUNET_assert (NULL == client_head);
731 while (NULL != (se = start)) 731 while (NULL != (se = start))
732 { 732 {
diff --git a/src/statistics/gnunet-statistics.c b/src/statistics/gnunet-statistics.c
index d05765c4a..857c9bde6 100644
--- a/src/statistics/gnunet-statistics.c
+++ b/src/statistics/gnunet-statistics.c
@@ -166,7 +166,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
166 GNUNET_assert (GNUNET_OK == 166 GNUNET_assert (GNUNET_OK ==
167 GNUNET_STATISTICS_watch_cancel (h, subsystem, name, &printer, h)); 167 GNUNET_STATISTICS_watch_cancel (h, subsystem, name, &printer, h));
168 GNUNET_STATISTICS_destroy (h, GNUNET_NO); 168 GNUNET_STATISTICS_destroy (h, GNUNET_NO);
169 h = NULL; 169 h = NULL;
170} 170}
171 171
172 172
@@ -248,16 +248,16 @@ main_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
248 * 248 *
249 * @param cls closure with our configuration 249 * @param cls closure with our configuration
250 * @param result #GNUNET_YES if the resolver is running 250 * @param result #GNUNET_YES if the resolver is running
251 */ 251 */
252static void 252static void
253resolver_test_task (void *cls, 253resolver_test_task (void *cls,
254 int result) 254 int result)
255{ 255{
256 struct GNUNET_CONFIGURATION_Handle *cfg = cls; 256 struct GNUNET_CONFIGURATION_Handle *cfg = cls;
257 257
258 if (GNUNET_YES != result) 258 if (GNUNET_YES != result)
259 { 259 {
260 FPRINTF (stderr, 260 FPRINTF (stderr,
261 _("Trying to connect to remote host, but service `%s' is not running\n"), "resolver"); 261 _("Trying to connect to remote host, but service `%s' is not running\n"), "resolver");
262 return; 262 return;
263 } 263 }
@@ -272,13 +272,13 @@ resolver_test_task (void *cls,
272 } 272 }
273 else if (65535 <= remote_port) 273 else if (65535 <= remote_port)
274 { 274 {
275 FPRINTF (stderr, 275 FPRINTF (stderr,
276 _("A port has to be between 1 and 65535 to connect to host `%s'\n"), remote_host); 276 _("A port has to be between 1 and 65535 to connect to host `%s'\n"), remote_host);
277 return; 277 return;
278 } 278 }
279 279
280 /* Manipulate configuration */ 280 /* Manipulate configuration */
281 GNUNET_CONFIGURATION_set_value_string (cfg, 281 GNUNET_CONFIGURATION_set_value_string (cfg,
282 "statistics", "UNIXPATH", ""); 282 "statistics", "UNIXPATH", "");
283 GNUNET_CONFIGURATION_set_value_string (cfg, 283 GNUNET_CONFIGURATION_set_value_string (cfg,
284 "statistics", "HOSTNAME", remote_host); 284 "statistics", "HOSTNAME", remote_host);
@@ -312,7 +312,7 @@ run (void *cls, char *const *args, const char *cfgfile,
312 set_value = GNUNET_YES; 312 set_value = GNUNET_YES;
313 } 313 }
314 if (NULL != remote_host) 314 if (NULL != remote_host)
315 GNUNET_CLIENT_service_test ("resolver", cfg, GNUNET_TIME_UNIT_SECONDS, 315 GNUNET_CLIENT_service_test ("resolver", cfg, GNUNET_TIME_UNIT_SECONDS,
316 &resolver_test_task, (void *) cfg); 316 &resolver_test_task, (void *) cfg);
317 else 317 else
318 GNUNET_SCHEDULER_add_now (&main_task, (void *) cfg); 318 GNUNET_SCHEDULER_add_now (&main_task, (void *) cfg);
diff --git a/src/statistics/statistics_api.c b/src/statistics/statistics_api.c
index 7aa109930..cecc1b0f6 100644
--- a/src/statistics/statistics_api.c
+++ b/src/statistics/statistics_api.c
@@ -277,11 +277,11 @@ update_memory_statistics (struct GNUNET_STATISTICS_Handle *h)
277#if HAVE_MALLINFO 277#if HAVE_MALLINFO
278 { 278 {
279 struct mallinfo mi; 279 struct mallinfo mi;
280 280
281 mi = mallinfo(); 281 mi = mallinfo();
282 current_heap_size = mi.uordblks + mi.fordblks; 282 current_heap_size = mi.uordblks + mi.fordblks;
283 } 283 }
284#endif 284#endif
285#if HAVE_GETRUSAGE 285#if HAVE_GETRUSAGE
286 { 286 {
287 struct rusage ru; 287 struct rusage ru;
@@ -289,7 +289,7 @@ update_memory_statistics (struct GNUNET_STATISTICS_Handle *h)
289 if (0 == getrusage (RUSAGE_SELF, &ru)) 289 if (0 == getrusage (RUSAGE_SELF, &ru))
290 { 290 {
291 current_rss = 1024LL * ru.ru_maxrss; 291 current_rss = 1024LL * ru.ru_maxrss;
292 } 292 }
293 } 293 }
294#endif 294#endif
295 if (current_heap_size > h->peak_heap_size) 295 if (current_heap_size > h->peak_heap_size)
@@ -381,12 +381,12 @@ static void
381do_disconnect (struct GNUNET_STATISTICS_Handle *h) 381do_disconnect (struct GNUNET_STATISTICS_Handle *h)
382{ 382{
383 struct GNUNET_STATISTICS_GetHandle *c; 383 struct GNUNET_STATISTICS_GetHandle *c;
384 384
385 if (NULL != h->th) 385 if (NULL != h->th)
386 { 386 {
387 GNUNET_CLIENT_notify_transmit_ready_cancel (h->th); 387 GNUNET_CLIENT_notify_transmit_ready_cancel (h->th);
388 h->th = NULL; 388 h->th = NULL;
389 } 389 }
390 if (NULL != h->client) 390 if (NULL != h->client)
391 { 391 {
392 GNUNET_CLIENT_disconnect (h->client); 392 GNUNET_CLIENT_disconnect (h->client);
@@ -421,10 +421,10 @@ try_connect (struct GNUNET_STATISTICS_Handle *h)
421 return GNUNET_NO; 421 return GNUNET_NO;
422 if (NULL != h->client) 422 if (NULL != h->client)
423 return GNUNET_YES; 423 return GNUNET_YES;
424 h->client = GNUNET_CLIENT_connect ("statistics", h->cfg); 424 h->client = GNUNET_CLIENT_connect ("statistics", h->cfg);
425 if (NULL != h->client) 425 if (NULL != h->client)
426 { 426 {
427 gn = h->action_head; 427 gn = h->action_head;
428 while (NULL != (gh = gn)) 428 while (NULL != (gh = gn))
429 { 429 {
430 gn = gh->next; 430 gn = gh->next;
@@ -601,8 +601,8 @@ process_watch_value (struct GNUNET_STATISTICS_Handle *h,
601 return GNUNET_SYSERR; 601 return GNUNET_SYSERR;
602 } 602 }
603 w = h->watches[wid]; 603 w = h->watches[wid];
604 if (NULL == w) 604 if (NULL == w)
605 return GNUNET_NO; 605 return GNUNET_NO;
606 (void) w->proc (w->proc_cls, w->subsystem, w->name, 606 (void) w->proc (w->proc_cls, w->subsystem, w->name,
607 GNUNET_ntohll (wvm->value), 607 GNUNET_ntohll (wvm->value),
608 0 != (ntohl (wvm->flags) & GNUNET_STATISTICS_PERSIST_BIT)); 608 0 != (ntohl (wvm->flags) & GNUNET_STATISTICS_PERSIST_BIT));
@@ -674,7 +674,7 @@ receive_stats (void *cls, const struct GNUNET_MessageHeader *msg)
674 else 674 else
675 { 675 {
676 h->receiving = GNUNET_NO; 676 h->receiving = GNUNET_NO;
677 } 677 }
678 h->current = NULL; 678 h->current = NULL;
679 schedule_action (h); 679 schedule_action (h);
680 if (NULL != c->cont) 680 if (NULL != c->cont)
@@ -686,7 +686,7 @@ receive_stats (void *cls, const struct GNUNET_MessageHeader *msg)
686 { 686 {
687 do_disconnect (h); 687 do_disconnect (h);
688 reconnect_later (h); 688 reconnect_later (h);
689 return; 689 return;
690 } 690 }
691 /* finally, look for more! */ 691 /* finally, look for more! */
692 LOG (GNUNET_ERROR_TYPE_DEBUG, 692 LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -697,12 +697,12 @@ receive_stats (void *cls, const struct GNUNET_MessageHeader *msg)
697 h->backoff = GNUNET_TIME_UNIT_MILLISECONDS; 697 h->backoff = GNUNET_TIME_UNIT_MILLISECONDS;
698 return; 698 return;
699 case GNUNET_MESSAGE_TYPE_STATISTICS_WATCH_VALUE: 699 case GNUNET_MESSAGE_TYPE_STATISTICS_WATCH_VALUE:
700 if (GNUNET_OK != 700 if (GNUNET_OK !=
701 (ret = process_watch_value (h, msg))) 701 (ret = process_watch_value (h, msg)))
702 { 702 {
703 do_disconnect (h); 703 do_disconnect (h);
704 if (GNUNET_NO == ret) 704 if (GNUNET_NO == ret)
705 h->backoff = GNUNET_TIME_UNIT_MILLISECONDS; 705 h->backoff = GNUNET_TIME_UNIT_MILLISECONDS;
706 reconnect_later (h); 706 reconnect_later (h);
707 return; 707 return;
708 } 708 }
@@ -710,7 +710,7 @@ receive_stats (void *cls, const struct GNUNET_MessageHeader *msg)
710 GNUNET_assert (h->watches_size > 0); 710 GNUNET_assert (h->watches_size > 0);
711 GNUNET_CLIENT_receive (h->client, &receive_stats, h, 711 GNUNET_CLIENT_receive (h->client, &receive_stats, h,
712 GNUNET_TIME_UNIT_FOREVER_REL); 712 GNUNET_TIME_UNIT_FOREVER_REL);
713 return; 713 return;
714 default: 714 default:
715 GNUNET_break (0); 715 GNUNET_break (0);
716 do_disconnect (h); 716 do_disconnect (h);
@@ -976,7 +976,7 @@ GNUNET_STATISTICS_destroy (struct GNUNET_STATISTICS_Handle *h, int sync_first)
976 h->current = NULL; 976 h->current = NULL;
977 } 977 }
978 } 978 }
979 next = h->action_head; 979 next = h->action_head;
980 while (NULL != (pos = next)) 980 while (NULL != (pos = next))
981 { 981 {
982 next = pos->next; 982 next = pos->next;
@@ -1018,7 +1018,7 @@ GNUNET_STATISTICS_destroy (struct GNUNET_STATISTICS_Handle *h, int sync_first)
1018 for (i = 0; i < h->watches_size; i++) 1018 for (i = 0; i < h->watches_size; i++)
1019 { 1019 {
1020 if (NULL == h->watches[i]) 1020 if (NULL == h->watches[i])
1021 continue; 1021 continue;
1022 GNUNET_free (h->watches[i]->subsystem); 1022 GNUNET_free (h->watches[i]->subsystem);
1023 GNUNET_free (h->watches[i]->name); 1023 GNUNET_free (h->watches[i]->name);
1024 GNUNET_free (h->watches[i]); 1024 GNUNET_free (h->watches[i]);
@@ -1232,7 +1232,7 @@ GNUNET_STATISTICS_watch (struct GNUNET_STATISTICS_Handle *handle,
1232 1232
1233 1233
1234/** 1234/**
1235 * Stop watching statistics from the peer. 1235 * Stop watching statistics from the peer.
1236 * 1236 *
1237 * @param handle identification of the statistics service 1237 * @param handle identification of the statistics service
1238 * @param subsystem limit to the specified subsystem, never NULL 1238 * @param subsystem limit to the specified subsystem, never NULL
@@ -1264,9 +1264,9 @@ GNUNET_STATISTICS_watch_cancel (struct GNUNET_STATISTICS_Handle *handle,
1264 GNUNET_free (w->name); 1264 GNUNET_free (w->name);
1265 GNUNET_free (w->subsystem); 1265 GNUNET_free (w->subsystem);
1266 GNUNET_free (w); 1266 GNUNET_free (w);
1267 handle->watches[i] = NULL; 1267 handle->watches[i] = NULL;
1268 return GNUNET_OK; 1268 return GNUNET_OK;
1269 } 1269 }
1270 } 1270 }
1271 return GNUNET_SYSERR; 1271 return GNUNET_SYSERR;
1272} 1272}
@@ -1305,7 +1305,7 @@ add_setter_action (struct GNUNET_STATISTICS_Handle *h, const char *name,
1305 for (ai = h->action_head; NULL != ai; ai = ai->next) 1305 for (ai = h->action_head; NULL != ai; ai = ai->next)
1306 { 1306 {
1307 if (! ( (0 == strcmp (ai->subsystem, h->subsystem)) && 1307 if (! ( (0 == strcmp (ai->subsystem, h->subsystem)) &&
1308 (0 == strcmp (ai->name, name)) && 1308 (0 == strcmp (ai->name, name)) &&
1309 ( (ACTION_UPDATE == ai->type) || 1309 ( (ACTION_UPDATE == ai->type) ||
1310 (ACTION_SET == ai->type) ) ) ) 1310 (ACTION_SET == ai->type) ) ) )
1311 continue; 1311 continue;
@@ -1351,7 +1351,7 @@ add_setter_action (struct GNUNET_STATISTICS_Handle *h, const char *name,
1351 } 1351 }
1352 ai->timeout = GNUNET_TIME_relative_to_absolute (SET_TRANSMIT_TIMEOUT); 1352 ai->timeout = GNUNET_TIME_relative_to_absolute (SET_TRANSMIT_TIMEOUT);
1353 ai->make_persistent = make_persistent; 1353 ai->make_persistent = make_persistent;
1354 return; 1354 return;
1355 } 1355 }
1356 /* no existing entry matches, create a fresh one */ 1356 /* no existing entry matches, create a fresh one */
1357 ai = GNUNET_malloc (sizeof (struct GNUNET_STATISTICS_GetHandle)); 1357 ai = GNUNET_malloc (sizeof (struct GNUNET_STATISTICS_GetHandle));
diff --git a/src/statistics/test_statistics_api.c b/src/statistics/test_statistics_api.c
index 5fb506ff7..47871fa7b 100644
--- a/src/statistics/test_statistics_api.c
+++ b/src/statistics/test_statistics_api.c
@@ -146,7 +146,7 @@ main (int argc, char *argv_ign[])
146 NULL); 146 NULL);
147 binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-statistics"); 147 binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-statistics");
148 proc = 148 proc =
149 GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, 149 GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL,
150 binary, 150 binary,
151 "gnunet-service-statistics", 151 "gnunet-service-statistics",
152 "-c", "test_statistics_api_data.conf", NULL); 152 "-c", "test_statistics_api_data.conf", NULL);
@@ -169,7 +169,7 @@ main (int argc, char *argv_ign[])
169 ok = 1; 169 ok = 1;
170 /* restart to check persistence! */ 170 /* restart to check persistence! */
171 proc = 171 proc =
172 GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, 172 GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL,
173 binary, 173 binary,
174 "gnunet-service-statistics", 174 "gnunet-service-statistics",
175 "-c", "test_statistics_api_data.conf", NULL); 175 "-c", "test_statistics_api_data.conf", NULL);
diff --git a/src/statistics/test_statistics_api_loop.c b/src/statistics/test_statistics_api_loop.c
index f9a3a3ba6..987b6c57b 100644
--- a/src/statistics/test_statistics_api_loop.c
+++ b/src/statistics/test_statistics_api_loop.c
@@ -93,7 +93,7 @@ main (int argc, char *argv_ign[])
93 93
94 binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-statistics"); 94 binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-statistics");
95 proc = 95 proc =
96 GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, 96 GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
97 NULL, NULL, 97 NULL, NULL,
98 binary, 98 binary,
99 "gnunet-service-statistics", 99 "gnunet-service-statistics",
diff --git a/src/statistics/test_statistics_api_watch.c b/src/statistics/test_statistics_api_watch.c
index 49cb04ef3..e75cab5f6 100644
--- a/src/statistics/test_statistics_api_watch.c
+++ b/src/statistics/test_statistics_api_watch.c
@@ -20,7 +20,7 @@
20/** 20/**
21 * @file statistics/test_statistics_api_watch.c 21 * @file statistics/test_statistics_api_watch.c
22 * @brief testcase for statistics_api.c watch functions 22 * @brief testcase for statistics_api.c watch functions
23 * @author Christian Grothoff 23 * @author Christian Grothoff
24 */ 24 */
25#include "platform.h" 25#include "platform.h"
26#include "gnunet_util_lib.h" 26#include "gnunet_util_lib.h"
@@ -119,7 +119,7 @@ main (int argc, char *argv_ign[])
119 }; 119 };
120 struct GNUNET_OS_Process *proc; 120 struct GNUNET_OS_Process *proc;
121 char *binary; 121 char *binary;
122 122
123 binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-statistics"); 123 binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-statistics");
124 proc = 124 proc =
125 GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, 125 GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL,