aboutsummaryrefslogtreecommitdiff
path: root/src/hostlist
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
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')
-rw-r--r--src/hostlist/test_gnunet_daemon_hostlist.c10
-rw-r--r--src/hostlist/test_gnunet_daemon_hostlist_learning.c10
2 files changed, 0 insertions, 20 deletions
diff --git a/src/hostlist/test_gnunet_daemon_hostlist.c b/src/hostlist/test_gnunet_daemon_hostlist.c
index f13f86dfa..5f07ce415 100644
--- a/src/hostlist/test_gnunet_daemon_hostlist.c
+++ b/src/hostlist/test_gnunet_daemon_hostlist.c
@@ -27,10 +27,6 @@
27#include "gnunet_arm_service.h" 27#include "gnunet_arm_service.h"
28#include "gnunet_transport_service.h" 28#include "gnunet_transport_service.h"
29 29
30#define VERBOSE GNUNET_NO
31
32#define START_ARM GNUNET_YES
33
34 30
35/** 31/**
36 * How long until we give up on transmitting the message? 32 * How long until we give up on transmitting the message?
@@ -47,9 +43,7 @@ struct PeerContext
47 struct GNUNET_TRANSPORT_Handle *th; 43 struct GNUNET_TRANSPORT_Handle *th;
48 struct GNUNET_MessageHeader *hello; 44 struct GNUNET_MessageHeader *hello;
49 struct GNUNET_TRANSPORT_GetHelloHandle *ghh; 45 struct GNUNET_TRANSPORT_GetHelloHandle *ghh;
50#if START_ARM
51 struct GNUNET_OS_Process *arm_proc; 46 struct GNUNET_OS_Process *arm_proc;
52#endif
53}; 47};
54 48
55static struct PeerContext p1; 49static struct PeerContext p1;
@@ -138,12 +132,10 @@ static void
138setup_peer (struct PeerContext *p, const char *cfgname) 132setup_peer (struct PeerContext *p, const char *cfgname)
139{ 133{
140 p->cfg = GNUNET_CONFIGURATION_create (); 134 p->cfg = GNUNET_CONFIGURATION_create ();
141#if START_ARM
142 p->arm_proc = 135 p->arm_proc =
143 GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-service-arm", 136 GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-service-arm",
144 "gnunet-service-arm", 137 "gnunet-service-arm",
145 "-c", cfgname, NULL); 138 "-c", cfgname, NULL);
146#endif
147 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); 139 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
148 p->th = 140 p->th =
149 GNUNET_TRANSPORT_connect (p->cfg, NULL, p, NULL, &notify_connect, NULL); 141 GNUNET_TRANSPORT_connect (p->cfg, NULL, p, NULL, &notify_connect, NULL);
@@ -157,7 +149,6 @@ waitpid_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
157{ 149{
158 struct PeerContext *p = cls; 150 struct PeerContext *p = cls;
159 151
160#if START_ARM
161 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Killing ARM process.\n"); 152 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Killing ARM process.\n");
162 if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM)) 153 if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM))
163 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); 154 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
@@ -167,7 +158,6 @@ waitpid_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
167 GNUNET_OS_process_get_pid (p->arm_proc)); 158 GNUNET_OS_process_get_pid (p->arm_proc));
168 GNUNET_OS_process_destroy (p->arm_proc); 159 GNUNET_OS_process_destroy (p->arm_proc);
169 p->arm_proc = NULL; 160 p->arm_proc = NULL;
170#endif
171 GNUNET_CONFIGURATION_destroy (p->cfg); 161 GNUNET_CONFIGURATION_destroy (p->cfg);
172} 162}
173 163
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);