*/
struct GNUNET_DATASTORE_Handle *dsh;
+ /**
+ * Our scheduler.
+ */
+ struct GNUNET_SCHEDULER_Handle *sched;
+
/**
* Our KSK URI.
*/
};
+/**
+ * Disconnect from the datastore.
+ *
+ * @param cls datastore handle
+ * @param tc scheduler context
+ */
+static void
+do_disconnect (void *cls,
+ const struct GNUNET_SCHEDULER_TaskContext *tc)
+{
+ struct GNUNET_DATASTORE_Handle *dsh = cls;
+
+ GNUNET_DATASTORE_disconnect (dsh,
+ GNUNET_NO);
+}
+
+
/**
* Continuation called to notify client about result of the
* operation.
if (GNUNET_OK != success)
{
/* error! */
- GNUNET_DATASTORE_disconnect (ac->dsh, GNUNET_NO);
+ GNUNET_SCHEDULER_add_continuation (ac->sched,
+ &do_disconnect,
+ ac->dsh,
+ GNUNET_SCHEDULER_REASON_PREREQ_DONE);
ac->cont (ac->cont_cls, NULL, msg);
GNUNET_FS_uri_destroy (ac->ksk_uri);
GNUNET_free (ac->pt);
if (ac->pos == ac->ksk_uri->data.ksk.keywordCount)
{
/* done! */
- GNUNET_DATASTORE_disconnect (ac->dsh, GNUNET_NO);
+ GNUNET_SCHEDULER_add_continuation (ac->sched,
+ &do_disconnect,
+ ac->dsh,
+ GNUNET_SCHEDULER_REASON_PREREQ_DONE);
ac->cont (ac->cont_cls, ac->ksk_uri, NULL);
GNUNET_FS_uri_destroy (ac->ksk_uri);
GNUNET_free (ac->pt);
ac->priority,
ac->anonymity,
ac->expiration,
+ -2, 1,
GNUNET_CONSTANTS_SERVICE_TIMEOUT,
&advertisement_cont,
ac);
ctx->cont = cont;
ctx->cont_cls = cont_cls;
ctx->dsh = dsh;
+ ctx->sched = h->sched;
ctx->ksk_uri = GNUNET_FS_uri_dup (ksk_uri);
ctx->nb = nb;
ctx->pt = pt;
GNUNET_free (fn);
return NULL;
}
+ ret->name = GNUNET_strdup (name);
ret->filename = fn;
return ret;
}
{
GNUNET_CRYPTO_rsa_key_free (namespace->key);
GNUNET_free (namespace->filename);
+ GNUNET_free (namespace->name);
GNUNET_free (namespace);
}
return GNUNET_OK;