adding configure code for --enable-benchmarks, --enable-expensive-tests, some clean up
[oweals/gnunet.git] / src / datastore / datastore_api.c
index 624d0cad7282b9057c9543ee27366ad251ce6adf..a3196530eab54a1f65c0dc9bf65e8370b7719f7f 100644 (file)
@@ -315,6 +315,11 @@ GNUNET_DATASTORE_disconnect (struct GNUNET_DATASTORE_Handle *h,
 {
   struct GNUNET_DATASTORE_QueueEntry *qe;
 
+  if (NULL != h->th)
+    {
+      GNUNET_CLIENT_notify_transmit_ready_cancel (h->th);
+      h->th = NULL;
+    }
   if (h->client != NULL)
     {
       GNUNET_CLIENT_disconnect (h->client, GNUNET_NO);
@@ -325,11 +330,6 @@ GNUNET_DATASTORE_disconnect (struct GNUNET_DATASTORE_Handle *h,
       GNUNET_SCHEDULER_cancel (h->reconnect_task);
       h->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
     }
-  if (NULL != h->th)
-    {
-      GNUNET_CLIENT_notify_transmit_ready_cancel (h->th);
-      h->th = NULL;
-    }
   while (NULL != (qe = h->queue_head))
     {
       GNUNET_assert (NULL != qe->response_proc);
@@ -585,6 +585,12 @@ receive_cb (void *cls,
   struct GNUNET_DATASTORE_QueueEntry *qe;
 
   h->in_receive = GNUNET_NO;
+  if (h->skip_next_messages > 0)
+    {
+      h->skip_next_messages--;
+      process_queue (h);
+      return;
+   } 
   if (NULL == (qe = h->queue_head))
     {
       GNUNET_break (0);
@@ -778,12 +784,6 @@ process_status_message (void *cls,
   int32_t status;
   int was_transmitted;
 
-  if (h->skip_next_messages > 0)
-    {
-      h->skip_next_messages--;
-      process_queue (h);
-      return;
-   } 
   if (NULL == (qe = h->queue_head))
     {
       GNUNET_break (0);
@@ -1252,12 +1252,6 @@ process_result_message (void *cls,
   struct ResultContext rc;
   const struct DataMessage *dm;
 
-  if (h->skip_next_messages > 0)
-    {
-      h->skip_next_messages--;
-      process_queue (h);
-      return;
-    }
   if (msg == NULL)
     {
       qe = h->queue_head;