aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-05-13 19:05:52 +0200
committerChristian Grothoff <christian@grothoff.org>2018-05-13 19:05:52 +0200
commit7ce988f356461caf32bb409bcf2cd48a749bfccb (patch)
tree08cfac89cdea7d0ae879593fbba0244b1986ef31 /src
parent787ad33cb683431e22a236b890f0e349e1d3f8fb (diff)
downloadgnunet-7ce988f356461caf32bb409bcf2cd48a749bfccb.tar.gz
gnunet-7ce988f356461caf32bb409bcf2cd48a749bfccb.zip
fix shutdown order
Diffstat (limited to 'src')
-rw-r--r--src/gns/gnunet-gns-benchmark.c19
1 files 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
96 * Observed latency, set once we got a reply. 96 * Observed latency, set once we got a reply.
97 */ 97 */
98 struct GNUNET_TIME_Relative latency; 98 struct GNUNET_TIME_Relative latency;
99 99
100 /** 100 /**
101 * Category of the request. 101 * Category of the request.
102 */ 102 */
103 enum RequestCategory cat; 103 enum RequestCategory cat;
104 104
105}; 105};
106 106
107 107
@@ -252,7 +252,7 @@ process_queue (void *cls)
252 if (NULL == (req = todo_head)) 252 if (NULL == (req = todo_head))
253 { 253 {
254 struct GNUNET_TIME_Absolute at; 254 struct GNUNET_TIME_Absolute at;
255 255
256 if (NULL == (req = act_head)) 256 if (NULL == (req = act_head))
257 { 257 {
258 GNUNET_SCHEDULER_shutdown (); 258 GNUNET_SCHEDULER_shutdown ();
@@ -327,7 +327,7 @@ do_shutdown (void *cls)
327 rp[rc] = 0; 327 rp[rc] = 0;
328 } 328 }
329 for (req = succ_head;NULL != req; req = req->next) 329 for (req = succ_head;NULL != req; req = req->next)
330 { 330 {
331 GNUNET_assert (rp[req->cat] < replies[req->cat]); 331 GNUNET_assert (rp[req->cat] < replies[req->cat]);
332 ra[req->cat][rp[req->cat]++] = req; 332 ra[req->cat][rp[req->cat]++] = req;
333 } 333 }
@@ -377,12 +377,6 @@ do_shutdown (void *cls)
377 failures[rc]); 377 failures[rc]);
378 GNUNET_free (ra[rc]); 378 GNUNET_free (ra[rc]);
379 } 379 }
380
381 if (NULL != gns)
382 {
383 GNUNET_GNS_disconnect (gns);
384 gns = NULL;
385 }
386 if (NULL != t) 380 if (NULL != t)
387 { 381 {
388 GNUNET_SCHEDULER_cancel (t); 382 GNUNET_SCHEDULER_cancel (t);
@@ -409,6 +403,11 @@ do_shutdown (void *cls)
409 req); 403 req);
410 free_request (req); 404 free_request (req);
411 } 405 }
406 if (NULL != gns)
407 {
408 GNUNET_GNS_disconnect (gns);
409 gns = NULL;
410 }
412} 411}
413 412
414 413