aboutsummaryrefslogtreecommitdiff
path: root/src/fs/gnunet-service-fs_put.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs/gnunet-service-fs_put.c')
-rw-r--r--src/fs/gnunet-service-fs_put.c41
1 files changed, 33 insertions, 8 deletions
diff --git a/src/fs/gnunet-service-fs_put.c b/src/fs/gnunet-service-fs_put.c
index eb7289f1e..862a795ba 100644
--- a/src/fs/gnunet-service-fs_put.c
+++ b/src/fs/gnunet-service-fs_put.c
@@ -26,15 +26,12 @@
26#include "platform.h" 26#include "platform.h"
27#include "gnunet-service-fs_put.h" 27#include "gnunet-service-fs_put.h"
28 28
29/* FIXME: below are only old code fragments to use... */
30
31 29
32/** 30/**
33 * Request to datastore for DHT PUTs (or NULL). 31 * Request to datastore for DHT PUTs (or NULL).
34 */ 32 */
35static struct GNUNET_DATASTORE_QueueEntry *dht_qe; 33static struct GNUNET_DATASTORE_QueueEntry *dht_qe;
36 34
37
38/** 35/**
39 * Type we will request for the next DHT PUT round from the datastore. 36 * Type we will request for the next DHT PUT round from the datastore.
40 */ 37 */
@@ -52,9 +49,6 @@ static GNUNET_SCHEDULER_TaskIdentifier dht_task;
52static unsigned int zero_anonymity_count_estimate; 49static unsigned int zero_anonymity_count_estimate;
53 50
54 51
55
56
57
58/** 52/**
59 * Task that is run periodically to obtain blocks for DHT PUTs. 53 * Task that is run periodically to obtain blocks for DHT PUTs.
60 * 54 *
@@ -101,7 +95,6 @@ consider_dht_put_gathering (void *cls)
101} 95}
102 96
103 97
104
105/** 98/**
106 * Store content in DHT. 99 * Store content in DHT.
107 * 100 *
@@ -172,7 +165,6 @@ process_dht_put_content (void *cls,
172} 165}
173 166
174 167
175
176/** 168/**
177 * Task that is run periodically to obtain blocks for DHT PUTs. 169 * Task that is run periodically to obtain blocks for DHT PUTs.
178 * 170 *
@@ -195,3 +187,36 @@ gather_dht_put_blocks (void *cls,
195 GNUNET_assert (dht_qe != NULL); 187 GNUNET_assert (dht_qe != NULL);
196 } 188 }
197} 189}
190
191
192/**
193 * Setup the module.
194 *
195 * @param cfg configuration to use
196 */
197void
198GSF_put_init_ (struct GNUNET_CONFIGURATION_Handle *cfg)
199{
200 dht_task = GNUNET_SCHEDULER_add_now (&gather_dht_put_blocks, NULL);
201}
202
203
204/**
205 * Shutdown the module.
206 */
207void
208GSF_put_done_ ()
209{
210 if (GNUNET_SCHEDULER_NO_TASK != dht_task)
211 {
212 GNUNET_SCHEDULER_cancel (dht_task);
213 dht_task = GNUNET_SCHEDULER_NO_TASK;
214 }
215 if (NULL != dht_qe)
216 {
217 GNUNET_DATASTORE_cancel (dht_qe);
218 dht_qe = NULL;
219 }
220}
221
222/* end of gnunet-service-fs_put.c */