From 7ce988f356461caf32bb409bcf2cd48a749bfccb Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 13 May 2018 19:05:52 +0200 Subject: [PATCH] fix shutdown order --- src/gns/gnunet-gns-benchmark.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/gns/gnunet-gns-benchmark.c b/src/gns/gnunet-gns-benchmark.c index 7f47fd9ca..630add3d9 100644 --- a/src/gns/gnunet-gns-benchmark.c +++ b/src/gns/gnunet-gns-benchmark.c @@ -96,12 +96,12 @@ struct Request * Observed latency, set once we got a reply. */ struct GNUNET_TIME_Relative latency; - + /** * Category of the request. */ enum RequestCategory cat; - + }; @@ -252,7 +252,7 @@ process_queue (void *cls) if (NULL == (req = todo_head)) { struct GNUNET_TIME_Absolute at; - + if (NULL == (req = act_head)) { GNUNET_SCHEDULER_shutdown (); @@ -327,7 +327,7 @@ do_shutdown (void *cls) rp[rc] = 0; } for (req = succ_head;NULL != req; req = req->next) - { + { GNUNET_assert (rp[req->cat] < replies[req->cat]); ra[req->cat][rp[req->cat]++] = req; } @@ -377,12 +377,6 @@ do_shutdown (void *cls) failures[rc]); GNUNET_free (ra[rc]); } - - if (NULL != gns) - { - GNUNET_GNS_disconnect (gns); - gns = NULL; - } if (NULL != t) { GNUNET_SCHEDULER_cancel (t); @@ -409,6 +403,11 @@ do_shutdown (void *cls) req); free_request (req); } + if (NULL != gns) + { + GNUNET_GNS_disconnect (gns); + gns = NULL; + } } -- 2.25.1