aboutsummaryrefslogtreecommitdiff
path: root/src/core/test_core_quota_compliance.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/test_core_quota_compliance.c')
-rw-r--r--src/core/test_core_quota_compliance.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/core/test_core_quota_compliance.c b/src/core/test_core_quota_compliance.c
index 88a915095..7f675a637 100644
--- a/src/core/test_core_quota_compliance.c
+++ b/src/core/test_core_quota_compliance.c
@@ -38,8 +38,6 @@
38#define ASYMMETRIC_SEND_LIMITED 1 38#define ASYMMETRIC_SEND_LIMITED 1
39#define ASYMMETRIC_RECV_LIMITED 2 39#define ASYMMETRIC_RECV_LIMITED 2
40 40
41#define START_ARM GNUNET_YES
42
43/** 41/**
44 * Note that this value must not significantly exceed 42 * Note that this value must not significantly exceed
45 * 'MAX_PENDING' in 'gnunet-service-transport.c', otherwise 43 * 'MAX_PENDING' in 'gnunet-service-transport.c', otherwise
@@ -84,9 +82,7 @@ struct PeerContext
84 struct GNUNET_STATISTICS_Handle *stats; 82 struct GNUNET_STATISTICS_Handle *stats;
85 struct GNUNET_TRANSPORT_GetHelloHandle *ghh; 83 struct GNUNET_TRANSPORT_GetHelloHandle *ghh;
86 int connect_status; 84 int connect_status;
87#if START_ARM
88 struct GNUNET_OS_Process *arm_proc; 85 struct GNUNET_OS_Process *arm_proc;
89#endif
90}; 86};
91 87
92static struct PeerContext p1; 88static struct PeerContext p1;
@@ -146,6 +142,8 @@ terminate_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
146 p1.th = NULL; 142 p1.th = NULL;
147 GNUNET_TRANSPORT_disconnect (p2.th); 143 GNUNET_TRANSPORT_disconnect (p2.th);
148 p2.th = NULL; 144 p2.th = NULL;
145 GNUNET_free_non_null (p1.hello);
146 GNUNET_free_non_null (p2.hello);
149} 147}
150 148
151 149
@@ -574,12 +572,10 @@ setup_peer (struct PeerContext *p, const char *cfgname)
574 572
575 binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm"); 573 binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm");
576 p->cfg = GNUNET_CONFIGURATION_create (); 574 p->cfg = GNUNET_CONFIGURATION_create ();
577#if START_ARM
578 p->arm_proc = 575 p->arm_proc =
579 GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, binary, 576 GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, binary,
580 "gnunet-service-arm", 577 "gnunet-service-arm",
581 "-c", cfgname, NULL); 578 "-c", cfgname, NULL);
582#endif
583 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); 579 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
584 p->stats = GNUNET_STATISTICS_create ("core", p->cfg); 580 p->stats = GNUNET_STATISTICS_create ("core", p->cfg);
585 GNUNET_assert (p->stats != NULL); 581 GNUNET_assert (p->stats != NULL);
@@ -642,7 +638,6 @@ run (void *cls, char *const *args, const char *cfgfile,
642static void 638static void
643stop_arm (struct PeerContext *p) 639stop_arm (struct PeerContext *p)
644{ 640{
645#if START_ARM
646 if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM)) 641 if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM))
647 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); 642 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
648 if (GNUNET_OS_process_wait (p->arm_proc) != GNUNET_OK) 643 if (GNUNET_OS_process_wait (p->arm_proc) != GNUNET_OK)
@@ -651,7 +646,6 @@ stop_arm (struct PeerContext *p)
651 GNUNET_OS_process_get_pid (p->arm_proc)); 646 GNUNET_OS_process_get_pid (p->arm_proc));
652 GNUNET_OS_process_destroy (p->arm_proc); 647 GNUNET_OS_process_destroy (p->arm_proc);
653 p->arm_proc = NULL; 648 p->arm_proc = NULL;
654#endif
655 GNUNET_CONFIGURATION_destroy (p->cfg); 649 GNUNET_CONFIGURATION_destroy (p->cfg);
656} 650}
657 651