aboutsummaryrefslogtreecommitdiff
path: root/src/hostlist/test_gnunet_daemon_hostlist_learning.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-06-23 22:24:50 +0000
committerChristian Grothoff <christian@grothoff.org>2012-06-23 22:24:50 +0000
commitd30c25b427875a16cc46cfd091f595f119e570bc (patch)
tree7e421bfae7f6efc16834816d30c81356d3c5b041 /src/hostlist/test_gnunet_daemon_hostlist_learning.c
parent8e6c69b6322f9d3f3f2a32040431a3b056302132 (diff)
downloadgnunet-d30c25b427875a16cc46cfd091f595f119e570bc.tar.gz
gnunet-d30c25b427875a16cc46cfd091f595f119e570bc.zip
-LRN: Change logskipping to use functions only:
Remember these weird "skip_log" functions in my gdb backtraces? I hope that this patch will get rid of them. Shouldn't affect existing uses of the API.
Diffstat (limited to 'src/hostlist/test_gnunet_daemon_hostlist_learning.c')
-rw-r--r--src/hostlist/test_gnunet_daemon_hostlist_learning.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/src/hostlist/test_gnunet_daemon_hostlist_learning.c b/src/hostlist/test_gnunet_daemon_hostlist_learning.c
index b7d96687c..6f0ab4c9e 100644
--- a/src/hostlist/test_gnunet_daemon_hostlist_learning.c
+++ b/src/hostlist/test_gnunet_daemon_hostlist_learning.c
@@ -30,8 +30,6 @@
30#include "gnunet_resolver_service.h" 30#include "gnunet_resolver_service.h"
31#include "gnunet_statistics_service.h" 31#include "gnunet_statistics_service.h"
32 32
33#define START_ARM GNUNET_YES
34
35#define MAX_URL_LEN 1000 33#define MAX_URL_LEN 1000
36 34
37/** 35/**
@@ -49,9 +47,7 @@ struct PeerContext
49 struct GNUNET_MessageHeader *hello; 47 struct GNUNET_MessageHeader *hello;
50 struct GNUNET_CORE_Handle *core; 48 struct GNUNET_CORE_Handle *core;
51 struct GNUNET_STATISTICS_Handle *stats; 49 struct GNUNET_STATISTICS_Handle *stats;
52#if START_ARM
53 struct GNUNET_OS_Process *arm_proc; 50 struct GNUNET_OS_Process *arm_proc;
54#endif
55}; 51};
56 52
57static int timeout; 53static int timeout;
@@ -147,7 +143,6 @@ shutdown_testcase ()
147 GNUNET_CORE_disconnect (learn_peer.core); 143 GNUNET_CORE_disconnect (learn_peer.core);
148 learn_peer.core = NULL; 144 learn_peer.core = NULL;
149 } 145 }
150#if START_ARM
151 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 146 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
152 "Killing hostlist server ARM process.\n"); 147 "Killing hostlist server ARM process.\n");
153 if (0 != GNUNET_OS_process_kill (adv_peer.arm_proc, SIGTERM)) 148 if (0 != GNUNET_OS_process_kill (adv_peer.arm_proc, SIGTERM))
@@ -164,7 +159,6 @@ shutdown_testcase ()
164 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); 159 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid");
165 GNUNET_OS_process_destroy (learn_peer.arm_proc); 160 GNUNET_OS_process_destroy (learn_peer.arm_proc);
166 learn_peer.arm_proc = NULL; 161 learn_peer.arm_proc = NULL;
167#endif
168 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutdown complete....\n"); 162 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutdown complete....\n");
169} 163}
170 164
@@ -390,12 +384,10 @@ setup_learn_peer (struct PeerContext *p, const char *cfgname)
390 unsigned int result; 384 unsigned int result;
391 385
392 p->cfg = GNUNET_CONFIGURATION_create (); 386 p->cfg = GNUNET_CONFIGURATION_create ();
393#if START_ARM
394 p->arm_proc = 387 p->arm_proc =
395 GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-service-arm", 388 GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-service-arm",
396 "gnunet-service-arm", 389 "gnunet-service-arm",
397 "-c", cfgname, NULL); 390 "-c", cfgname, NULL);
398#endif
399 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); 391 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
400 if (GNUNET_OK == 392 if (GNUNET_OK ==
401 GNUNET_CONFIGURATION_get_value_string (p->cfg, "HOSTLIST", "HOSTLISTFILE", 393 GNUNET_CONFIGURATION_get_value_string (p->cfg, "HOSTLIST", "HOSTLISTFILE",
@@ -423,12 +415,10 @@ static void
423setup_adv_peer (struct PeerContext *p, const char *cfgname) 415setup_adv_peer (struct PeerContext *p, const char *cfgname)
424{ 416{
425 p->cfg = GNUNET_CONFIGURATION_create (); 417 p->cfg = GNUNET_CONFIGURATION_create ();
426#if START_ARM
427 p->arm_proc = 418 p->arm_proc =
428 GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-service-arm", 419 GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-service-arm",
429 "gnunet-service-arm", 420 "gnunet-service-arm",
430 "-c", cfgname, NULL); 421 "-c", cfgname, NULL);
431#endif
432 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); 422 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
433 p->stats = GNUNET_STATISTICS_create ("hostlist", p->cfg); 423 p->stats = GNUNET_STATISTICS_create ("hostlist", p->cfg);
434 GNUNET_assert (NULL != p->stats); 424 GNUNET_assert (NULL != p->stats);