aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-09-11 18:36:31 +0000
committerChristian Grothoff <christian@grothoff.org>2016-09-11 18:36:31 +0000
commit6b1872cb726e672b0e625c46075dab8ed41034d8 (patch)
treeb8965058b9d02a80d627ad158a3b2479acf6d560
parent18cb6bc2d5cd2a1f3c985516a658000b70cab2ba (diff)
downloadgnunet-6b1872cb726e672b0e625c46075dab8ed41034d8.tar.gz
gnunet-6b1872cb726e672b0e625c46075dab8ed41034d8.zip
fix dht kill issue
-rw-r--r--src/dht/gnunet-service-dht.c1
-rw-r--r--src/dht/gnunet-service-dht_clients.c28
-rw-r--r--src/dht/gnunet-service-dht_clients.h6
3 files changed, 28 insertions, 7 deletions
diff --git a/src/dht/gnunet-service-dht.c b/src/dht/gnunet-service-dht.c
index 332d48a86..1e3dd339d 100644
--- a/src/dht/gnunet-service-dht.c
+++ b/src/dht/gnunet-service-dht.c
@@ -125,6 +125,7 @@ shutdown_task (void *cls)
125 } 125 }
126 GNUNET_free_non_null (GDS_my_hello); 126 GNUNET_free_non_null (GDS_my_hello);
127 GDS_my_hello = NULL; 127 GDS_my_hello = NULL;
128 GDS_CLIENTS_stop ();
128} 129}
129 130
130 131
diff --git a/src/dht/gnunet-service-dht_clients.c b/src/dht/gnunet-service-dht_clients.c
index 2e8d309db..38dbb64e5 100644
--- a/src/dht/gnunet-service-dht_clients.c
+++ b/src/dht/gnunet-service-dht_clients.c
@@ -626,11 +626,17 @@ handle_dht_local_get (void *cls, struct GNUNET_SERVER_Client *client,
626 /* start remote requests */ 626 /* start remote requests */
627 if (NULL != retry_task) 627 if (NULL != retry_task)
628 GNUNET_SCHEDULER_cancel (retry_task); 628 GNUNET_SCHEDULER_cancel (retry_task);
629 retry_task = GNUNET_SCHEDULER_add_now (&transmit_next_request_task, NULL); 629 retry_task = GNUNET_SCHEDULER_add_now (&transmit_next_request_task,
630 NULL);
630 /* perform local lookup */ 631 /* perform local lookup */
631 GDS_DATACACHE_handle_get (&get->key, cqr->type, cqr->xquery, xquery_size, 632 GDS_DATACACHE_handle_get (&get->key,
632 NULL, 0); 633 cqr->type,
633 GNUNET_SERVER_receive_done (client, GNUNET_OK); 634 cqr->xquery,
635 xquery_size,
636 NULL,
637 0);
638 GNUNET_SERVER_receive_done (client,
639 GNUNET_OK);
634} 640}
635 641
636 642
@@ -1515,15 +1521,23 @@ GDS_CLIENTS_init ()
1515 * Shutdown client subsystem. 1521 * Shutdown client subsystem.
1516 */ 1522 */
1517void 1523void
1518GDS_CLIENTS_done () 1524GDS_CLIENTS_stop ()
1519{ 1525{
1520 GNUNET_assert (client_head == NULL);
1521 GNUNET_assert (client_tail == NULL);
1522 if (NULL != retry_task) 1526 if (NULL != retry_task)
1523 { 1527 {
1524 GNUNET_SCHEDULER_cancel (retry_task); 1528 GNUNET_SCHEDULER_cancel (retry_task);
1525 retry_task = NULL; 1529 retry_task = NULL;
1526 } 1530 }
1531}
1532
1533/**
1534 * Shutdown client subsystem.
1535 */
1536void
1537GDS_CLIENTS_done ()
1538{
1539 GNUNET_assert (client_head == NULL);
1540 GNUNET_assert (client_tail == NULL);
1527 if (NULL != retry_heap) 1541 if (NULL != retry_heap)
1528 { 1542 {
1529 GNUNET_assert (0 == GNUNET_CONTAINER_heap_get_size (retry_heap)); 1543 GNUNET_assert (0 == GNUNET_CONTAINER_heap_get_size (retry_heap));
diff --git a/src/dht/gnunet-service-dht_clients.h b/src/dht/gnunet-service-dht_clients.h
index d8e1c184d..8a0931f6a 100644
--- a/src/dht/gnunet-service-dht_clients.h
+++ b/src/dht/gnunet-service-dht_clients.h
@@ -137,6 +137,12 @@ GDS_CLIENTS_process_put (uint32_t options,
137void 137void
138GDS_CLIENTS_init (void); 138GDS_CLIENTS_init (void);
139 139
140/**
141 * Shutdown client subsystem.
142 */
143void
144GDS_CLIENTS_stop (void);
145
140 146
141/** 147/**
142 * Shutdown client subsystem. 148 * Shutdown client subsystem.