pi->value.publish.duration =
GNUNET_TIME_absolute_get_duration (p->start_time);
pi->value.publish.anonymity = p->bo.anonymity_level;
+ pi->fsh = pc->h;
return pc->h->upcb (pc->h->upcb_cls, pi);
}
pc->fhc = NULL;
}
GNUNET_FS_file_information_destroy (pc->fi, NULL, NULL);
- if (pc->namespace != NULL)
- {
- GNUNET_FS_namespace_delete (pc->namespace, GNUNET_NO);
- pc->namespace = NULL;
- }
GNUNET_free_non_null (pc->nid);
GNUNET_free_non_null (pc->nuid);
GNUNET_free_non_null (pc->serialization);
static void
publish_sblock (struct GNUNET_FS_PublishContext *pc)
{
- if (NULL != pc->namespace)
- pc->sks_pc = GNUNET_FS_publish_sks (pc->h, pc->namespace, pc->nid, pc->nuid,
- pc->fi->meta, pc->fi->chk_uri, &pc->fi->bo,
- pc->options, &publish_sblocks_cont, pc);
+ if (NULL != pc->ns)
+ pc->sks_pc = GNUNET_FS_publish_sks (pc->h,
+ pc->ns,
+ pc->nid,
+ pc->nuid,
+ pc->fi->meta,
+ pc->fi->chk_uri,
+ &pc->fi->bo,
+ pc->options,
+ &publish_sblocks_cont, pc);
else
publish_sblocks_cont (pc, NULL, NULL);
}
* @param res resulting hash, NULL on error
*/
static void
-hash_for_index_cb (void *cls, const GNUNET_HashCode * res)
+hash_for_index_cb (void *cls, const struct GNUNET_HashCode * res)
{
struct GNUNET_FS_PublishContext *pc = cls;
struct GNUNET_FS_FileInformation *p;
*
* @param h handle to the file sharing subsystem
* @param fi information about the file or directory structure to publish
- * @param namespace namespace to publish the file in, NULL for no namespace
+ * @param ns namespace to publish the file in, NULL for no namespace
* @param nid identifier to use for the publishd content in the namespace
* (can be NULL, must be NULL if namespace is NULL)
* @param nuid update-identifier that will be used for future updates
struct GNUNET_FS_PublishContext *
GNUNET_FS_publish_start (struct GNUNET_FS_Handle *h,
struct GNUNET_FS_FileInformation *fi,
- struct GNUNET_FS_Namespace *namespace, const char *nid,
+ const struct GNUNET_CRYPTO_EccPrivateKey *ns,
+ const char *nid,
const char *nuid,
enum GNUNET_FS_PublishOptions options)
{
{
dsh = NULL;
}
- ret = GNUNET_malloc (sizeof (struct GNUNET_FS_PublishContext));
+ ret = GNUNET_new (struct GNUNET_FS_PublishContext);
ret->dsh = dsh;
ret->h = h;
ret->fi = fi;
- ret->namespace = namespace;
- ret->options = options;
- if (namespace != NULL)
+ if (NULL != ns)
{
- namespace->rc++;
+ ret->ns = GNUNET_new (struct GNUNET_CRYPTO_EccPrivateKey);
+ *ret->ns = *ns;
GNUNET_assert (NULL != nid);
ret->nid = GNUNET_strdup (nid);
if (NULL != nuid)
ret->nuid = GNUNET_strdup (nuid);
}
+ ret->options = options;
/* signal start */
GNUNET_FS_file_information_inspect (ret->fi, &fip_signal_start, ret);
ret->fi_pos = ret->fi;