fix
[oweals/gnunet.git] / src / fs / gnunet-service-fs_drq.c
index fde34187a323da074bde43e71cdeb32e13294aad..b549c6707ab5979988bd9eb5758eeb45ad7b9aea 100644 (file)
@@ -113,10 +113,6 @@ static struct DatastoreRequestQueue *drq_head;
  */
 static struct DatastoreRequestQueue *drq_tail;
 
-/**
- * Our connection to the datastore.
- */
-static struct GNUNET_DATASTORE_Handle *dsh;
 
 /**
  * Pointer to the currently actively running request,
@@ -222,9 +218,10 @@ run_next_request (void *cls,
   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);
 }
 
 
@@ -294,9 +291,6 @@ shutdown_task (void *cls,
              "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;
@@ -464,7 +458,6 @@ drq_remove_cont (void *cls,
   rc->cont (rc->cont_cls,
            success,
            msg);
-  GNUNET_DATASTORE_disconnect (rc->rmdsh, GNUNET_NO);
   GNUNET_free (rc);
 }
 
@@ -493,8 +486,6 @@ GNUNET_FS_drq_remove (const GNUNET_HashCode *key,
   struct GNUNET_DATASTORE_Handle *rmdsh; 
   struct RemoveContext *rc;
 
-  rmdsh = GNUNET_DATASTORE_connect (cfg,
-                                   sched);
   if (rmdsh == NULL)
     {
       GNUNET_break (0);
@@ -508,8 +499,10 @@ GNUNET_FS_drq_remove (const GNUNET_HashCode *key,
   rc->cont_cls = cont_cls;
   rc->rmdsh = rmdsh;
   GNUNET_DATASTORE_remove (rmdsh, key, size, data,
+                          -3, 128,
+                          timeout,
                           &drq_remove_cont, 
-                          rc, timeout);
+                          rc);
 }