/**
* Datastore entry type we are doing the 'get' for.
*/
- uint32_t type;
+ enum GNUNET_BLOCK_Type type;
/**
* Is this request at the head of the queue irrespective of its
*/
static struct DatastoreRequestQueue *drq_tail;
-/**
- * Our connection to the datastore.
- */
-static struct GNUNET_DATASTORE_Handle *dsh;
/**
* Pointer to the currently actively running request,
const GNUNET_HashCode * key,
uint32_t size,
const void *data,
- uint32_t type,
+ enum GNUNET_BLOCK_Type type,
uint32_t priority,
uint32_t anonymity,
struct GNUNET_TIME_Absolute
GNUNET_DATASTORE_get (dsh,
&gc->key,
gc->type,
+ 42 /* FIXME */, 64 /* FIXME */,
+ GNUNET_TIME_absolute_get_remaining(gc->timeout),
&get_iterator,
- gc,
- GNUNET_TIME_absolute_get_remaining(gc->timeout));
+ gc);
}
"DRQ shutdown initiated\n");
#endif
GNUNET_assert (NULL != dsh);
- GNUNET_DATASTORE_disconnect (dsh,
- GNUNET_NO);
- dsh = NULL;
while (NULL != (drq = drq_head))
{
drq_head = drq->next;
drq_tail = NULL;
if (drq_running != NULL)
{
- GNUNET_SCHEDULER_cancel (sched,
- drq_running->task);
- drq_running->iter (drq_running->iter_cls,
- NULL, 0, NULL, 0, 0, 0,
- GNUNET_TIME_UNIT_ZERO_ABS, 0);
+ if (drq_running->task != GNUNET_SCHEDULER_NO_TASK)
+ {
+ GNUNET_SCHEDULER_cancel (sched,
+ drq_running->task);
+ }
+ if (drq_running->iter != NULL)
+ {
+ drq_running->iter (drq_running->iter_cls,
+ NULL, 0, NULL, 0, 0, 0,
+ GNUNET_TIME_UNIT_ZERO_ABS, 0);
+ }
GNUNET_free (drq_running);
drq_running = NULL;
}
*/
struct DatastoreRequestQueue *
GNUNET_FS_drq_get (const GNUNET_HashCode * key,
- uint32_t type,
+ enum GNUNET_BLOCK_Type type,
GNUNET_DATASTORE_Iterator iter,
void *iter_cls,
struct GNUNET_TIME_Relative timeout,
rc->cont (rc->cont_cls,
success,
msg);
- GNUNET_DATASTORE_disconnect (rc->rmdsh, GNUNET_NO);
GNUNET_free (rc);
}
struct GNUNET_DATASTORE_Handle *rmdsh;
struct RemoveContext *rc;
- rmdsh = GNUNET_DATASTORE_connect (cfg,
- sched);
if (rmdsh == NULL)
{
GNUNET_break (0);
rc->cont_cls = cont_cls;
rc->rmdsh = rmdsh;
GNUNET_DATASTORE_remove (rmdsh, key, size, data,
+ -3, 128,
+ timeout,
&drq_remove_cont,
- rc, timeout);
+ rc);
}