aboutsummaryrefslogtreecommitdiff
path: root/src/datastore
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-05-30 13:27:24 +0000
committerChristian Grothoff <christian@grothoff.org>2011-05-30 13:27:24 +0000
commitc14b2dc0cb0c501851b8e0091b5114701df34089 (patch)
tree9d205bb2d5cfa4d72de1be885592c4c153dffea9 /src/datastore
parentc17859012a3847d6c231cecb3e72342b92a0fe8b (diff)
downloadgnunet-c14b2dc0cb0c501851b8e0091b5114701df34089.tar.gz
gnunet-c14b2dc0cb0c501851b8e0091b5114701df34089.zip
proper shutdown
Diffstat (limited to 'src/datastore')
-rw-r--r--src/datastore/datastore_api.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/datastore/datastore_api.c b/src/datastore/datastore_api.c
index 33b5cc232..07e48931e 100644
--- a/src/datastore/datastore_api.c
+++ b/src/datastore/datastore_api.c
@@ -325,6 +325,11 @@ GNUNET_DATASTORE_disconnect (struct GNUNET_DATASTORE_Handle *h,
325 GNUNET_SCHEDULER_cancel (h->reconnect_task); 325 GNUNET_SCHEDULER_cancel (h->reconnect_task);
326 h->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 326 h->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
327 } 327 }
328 if (NULL != h->th)
329 {
330 GNUNET_CLIENT_notify_transmit_ready_cancel (h->th);
331 h->th = NULL;
332 }
328 while (NULL != (qe = h->queue_head)) 333 while (NULL != (qe = h->queue_head))
329 { 334 {
330 GNUNET_assert (NULL != qe->response_proc); 335 GNUNET_assert (NULL != qe->response_proc);
@@ -344,11 +349,13 @@ GNUNET_DATASTORE_disconnect (struct GNUNET_DATASTORE_Handle *h,
344 h)) 349 h))
345 return; 350 return;
346 GNUNET_CLIENT_disconnect (h->client, GNUNET_NO); 351 GNUNET_CLIENT_disconnect (h->client, GNUNET_NO);
352 h->client = NULL;
347 } 353 }
348 GNUNET_break (0); 354 GNUNET_break (0);
349 } 355 }
350 GNUNET_STATISTICS_destroy (h->stats, 356 GNUNET_STATISTICS_destroy (h->stats,
351 GNUNET_NO); 357 GNUNET_NO);
358 h->stats = NULL;
352 GNUNET_free (h); 359 GNUNET_free (h);
353} 360}
354 361
@@ -603,6 +610,7 @@ transmit_request (void *cls,
603 qe->was_transmitted = GNUNET_YES; 610 qe->was_transmitted = GNUNET_YES;
604 GNUNET_SCHEDULER_cancel (qe->task); 611 GNUNET_SCHEDULER_cancel (qe->task);
605 qe->task = GNUNET_SCHEDULER_NO_TASK; 612 qe->task = GNUNET_SCHEDULER_NO_TASK;
613 GNUNET_assert (GNUNET_NO == h->in_receive);
606 h->in_receive = GNUNET_YES; 614 h->in_receive = GNUNET_YES;
607 GNUNET_CLIENT_receive (h->client, 615 GNUNET_CLIENT_receive (h->client,
608 qe->response_proc, 616 qe->response_proc,
@@ -675,6 +683,8 @@ process_queue (struct GNUNET_DATASTORE_Handle *h)
675 GNUNET_YES, 683 GNUNET_YES,
676 &transmit_request, 684 &transmit_request,
677 h); 685 h);
686 GNUNET_assert (GNUNET_NO == h->in_receive);
687 GNUNET_break (NULL != h->th);
678} 688}
679 689
680 690