diff options
-rw-r--r-- | src/rps/test_rps.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/rps/test_rps.c b/src/rps/test_rps.c index 108c1bd34..01777bd90 100644 --- a/src/rps/test_rps.c +++ b/src/rps/test_rps.c | |||
@@ -46,7 +46,6 @@ uint32_t num_peers; | |||
46 | //#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30) | 46 | //#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30) |
47 | static struct GNUNET_TIME_Relative timeout; | 47 | static struct GNUNET_TIME_Relative timeout; |
48 | 48 | ||
49 | |||
50 | /** | 49 | /** |
51 | * Portion of malicious peers | 50 | * Portion of malicious peers |
52 | */ | 51 | */ |
@@ -260,6 +259,10 @@ struct SingleTestRun | |||
260 | uint32_t num_requests; | 259 | uint32_t num_requests; |
261 | } cur_test_run; | 260 | } cur_test_run; |
262 | 261 | ||
262 | /** | ||
263 | * Are we shutting down? | ||
264 | */ | ||
265 | static int in_shutdown; | ||
263 | 266 | ||
264 | /** | 267 | /** |
265 | * Append arguments to file | 268 | * Append arguments to file |
@@ -476,6 +479,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
476 | { | 479 | { |
477 | unsigned int i; | 480 | unsigned int i; |
478 | 481 | ||
482 | in_shutdown = GNUNET_YES; | ||
479 | if (NULL != churn_task) | 483 | if (NULL != churn_task) |
480 | GNUNET_SCHEDULER_cancel (churn_task); | 484 | GNUNET_SCHEDULER_cancel (churn_task); |
481 | 485 | ||
@@ -625,7 +629,7 @@ rps_connect_adapter (void *cls, | |||
625 | */ | 629 | */ |
626 | static void | 630 | static void |
627 | rps_disconnect_adapter (void *cls, | 631 | rps_disconnect_adapter (void *cls, |
628 | void *op_result) | 632 | void *op_result) |
629 | { | 633 | { |
630 | struct GNUNET_RPS_Handle *h = op_result; | 634 | struct GNUNET_RPS_Handle *h = op_result; |
631 | GNUNET_RPS_disconnect (h); | 635 | GNUNET_RPS_disconnect (h); |
@@ -689,6 +693,8 @@ request_peers (void *cls, | |||
689 | { | 693 | { |
690 | struct RPSPeer *rps_peer = (struct RPSPeer *) cls; | 694 | struct RPSPeer *rps_peer = (struct RPSPeer *) cls; |
691 | 695 | ||
696 | if (GNUNET_YES == in_shutdown) | ||
697 | return; | ||
692 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 698 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
693 | "Requesting one peer\n"); | 699 | "Requesting one peer\n"); |
694 | 700 | ||