GNUnet  0.11.x
Functions
gnunet-service-fs_put.h File Reference

support for putting content into the DHT More...

#include "gnunet-service-fs.h"
Include dependency graph for gnunet-service-fs_put.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void GSF_put_init_ (void)
 Setup the module. More...
 
void GSF_put_done_ (void)
 Shutdown the module. More...
 

Detailed Description

support for putting content into the DHT

Author
Christian Grothoff

Definition in file gnunet-service-fs_put.h.

Function Documentation

◆ GSF_put_init_()

void GSF_put_init_ ( void  )

Setup the module.

Definition at line 250 of file gnunet-service-fs_put.c.

References PutOperator::dht_put_type, PutOperator::dht_task, gather_dht_put_blocks(), GNUNET_BLOCK_TYPE_ANY, and GNUNET_SCHEDULER_add_now().

Referenced by run().

251 {
252  unsigned int i;
253 
254  i = 0;
256  {
257  operators[i].dht_task =
259  i++;
260  }
261 }
Any type of block, used as a wildcard when searching.
enum GNUNET_BLOCK_Type dht_put_type
Type we request from the datastore.
static void gather_dht_put_blocks(void *cls)
Task that is run periodically to obtain blocks for DHT PUTs.
struct GNUNET_SCHEDULER_Task * dht_task
ID of task that collects blocks for DHT PUTs.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_now(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run as soon as possible.
Definition: scheduler.c:1280
static struct PutOperator operators[]
ANY-terminated list of our operators (one per type of block that we're putting into the DHT)...
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GSF_put_done_()

void GSF_put_done_ ( void  )

Shutdown the module.

Definition at line 268 of file gnunet-service-fs_put.c.

References PutOperator::dht_put, PutOperator::dht_put_type, PutOperator::dht_qe, PutOperator::dht_task, GNUNET_BLOCK_TYPE_ANY, GNUNET_DATASTORE_cancel(), GNUNET_DHT_put_cancel(), and GNUNET_SCHEDULER_cancel().

Referenced by shutdown_task().

269 {
270  struct PutOperator *po;
271  unsigned int i;
272 
273  i = 0;
274  while ((po = &operators[i])->dht_put_type != GNUNET_BLOCK_TYPE_ANY)
275  {
276  if (NULL != po->dht_task)
277  {
279  po->dht_task = NULL;
280  }
281  if (NULL != po->dht_put)
282  {
284  po->dht_put = NULL;
285  }
286  if (NULL != po->dht_qe)
287  {
289  po->dht_qe = NULL;
290  }
291  i++;
292  }
293 }
void GNUNET_DHT_put_cancel(struct GNUNET_DHT_PutHandle *ph)
Cancels a DHT PUT operation.
Definition: dht_api.c:1035
Any type of block, used as a wildcard when searching.
enum GNUNET_BLOCK_Type dht_put_type
Type we request from the datastore.
struct GNUNET_SCHEDULER_Task * dht_task
ID of task that collects blocks for DHT PUTs.
struct GNUNET_DATASTORE_QueueEntry * dht_qe
Request to datastore for DHT PUTs (or NULL).
Context for each zero-anonymity iterator.
struct GNUNET_DHT_PutHandle * dht_put
Handle to PUT operation.
static struct PutOperator operators[]
ANY-terminated list of our operators (one per type of block that we're putting into the DHT)...
void GNUNET_DATASTORE_cancel(struct GNUNET_DATASTORE_QueueEntry *qe)
Cancel a datastore operation.
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
Definition: scheduler.c:966
Here is the call graph for this function:
Here is the caller graph for this function: