fix dht kill issue
authorChristian Grothoff <christian@grothoff.org>
Sun, 11 Sep 2016 18:36:31 +0000 (18:36 +0000)
committerChristian Grothoff <christian@grothoff.org>
Sun, 11 Sep 2016 18:36:31 +0000 (18:36 +0000)
src/dht/gnunet-service-dht.c
src/dht/gnunet-service-dht_clients.c
src/dht/gnunet-service-dht_clients.h

index 332d48a8608120dbc99a5752b91718e9b7227ce0..1e3dd339d8d14f18a677f03b73d555640bd96a17 100644 (file)
@@ -125,6 +125,7 @@ shutdown_task (void *cls)
   }
   GNUNET_free_non_null (GDS_my_hello);
   GDS_my_hello = NULL;
+  GDS_CLIENTS_stop ();
 }
 
 
index 2e8d309db0be3bbb1f77bdb79bd82399e4f9b040..38dbb64e5e02921cfce90f2e8c12396b3c7a12db 100644 (file)
@@ -626,11 +626,17 @@ handle_dht_local_get (void *cls, struct GNUNET_SERVER_Client *client,
   /* start remote requests */
   if (NULL != retry_task)
     GNUNET_SCHEDULER_cancel (retry_task);
-  retry_task = GNUNET_SCHEDULER_add_now (&transmit_next_request_task, NULL);
+  retry_task = GNUNET_SCHEDULER_add_now (&transmit_next_request_task,
+                                        NULL);
   /* perform local lookup */
-  GDS_DATACACHE_handle_get (&get->key, cqr->type, cqr->xquery, xquery_size,
-                            NULL, 0);
-  GNUNET_SERVER_receive_done (client, GNUNET_OK);
+  GDS_DATACACHE_handle_get (&get->key,
+                           cqr->type,
+                           cqr->xquery,
+                           xquery_size,
+                            NULL,
+                           0);
+  GNUNET_SERVER_receive_done (client,
+                             GNUNET_OK);
 }
 
 
@@ -1515,15 +1521,23 @@ GDS_CLIENTS_init ()
  * Shutdown client subsystem.
  */
 void
-GDS_CLIENTS_done ()
+GDS_CLIENTS_stop ()
 {
-  GNUNET_assert (client_head == NULL);
-  GNUNET_assert (client_tail == NULL);
   if (NULL != retry_task)
   {
     GNUNET_SCHEDULER_cancel (retry_task);
     retry_task = NULL;
   }
+}
+
+/**
+ * Shutdown client subsystem.
+ */
+void
+GDS_CLIENTS_done ()
+{
+  GNUNET_assert (client_head == NULL);
+  GNUNET_assert (client_tail == NULL);
   if (NULL != retry_heap)
   {
     GNUNET_assert (0 == GNUNET_CONTAINER_heap_get_size (retry_heap));
index d8e1c184d6a1f90c044d5dca37611f904c9b0509..8a0931f6a7cfba474086d79218ebb49175d3d60f 100644 (file)
@@ -137,6 +137,12 @@ GDS_CLIENTS_process_put (uint32_t options,
 void
 GDS_CLIENTS_init (void);
 
+/**
+ * Shutdown client subsystem.
+ */
+void
+GDS_CLIENTS_stop (void);
+
 
 /**
  * Shutdown client subsystem.