From: Christian Grothoff Date: Sat, 29 Aug 2009 21:47:57 +0000 (+0000) Subject: todo X-Git-Tag: initial-import-from-subversion-38251~23559 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=deaec843661af71fbea06125f79375e70c967345;p=oweals%2Fgnunet.git todo --- diff --git a/src/fs/fs_publish.c b/src/fs/fs_publish.c index 34d478b85..124f73743 100644 --- a/src/fs/fs_publish.c +++ b/src/fs/fs_publish.c @@ -257,13 +257,18 @@ publish_sblock (struct GNUNET_FS_PublishContext *sc) { struct GNUNET_FS_FileInformation *p; p = sc->fi; - - // FIXME: build sblock & call publish_block! - // FIXME: continuation should - // be releasing the datastore reserve - // (once implemented) - // FIXME: finally, signal overall completion + if (NULL != sc->namespace) + GNUNET_FS_publish_sks (sc->h, + sc->namespace, + sc->nid, + sc->nuid, + p->meta, + p->chk_uri, + p->expirationTime, + p->anonymity, + p->priority); + // FIXME: release the datastore reserve here! signal_publish_completion (p, sc); } @@ -282,15 +287,28 @@ static void publish_kblocks (struct GNUNET_FS_PublishContext *sc, struct GNUNET_FS_FileInformation *p) { - // FIXME: build all kblocks - // call publish_block on each - + unsigned int i; + // FIXME: use cps here instead... + for (i=0;ikeywords->data.ksk.keywordCount;i++) + GNUNET_FS_publish_ksk (sc->h, + p->keywords->data.ksk.keywords[i], + p->meta, + p->chk_uri, + p->expirationTime, + p->anonymity, + p->priority); GNUNET_FS_file_information_sync (p); if (NULL != p->dir) signal_publish_completion (p, sc); - - // last continuation should then call the main continuation again + sc->upload_task + = GNUNET_SCHEDULER_add_delayed (sc->h->sched, + GNUNET_NO, + GNUNET_SCHEDULER_PRIORITY_BACKGROUND, + GNUNET_SCHEDULER_NO_TASK, + GNUNET_TIME_UNIT_ZERO, + &do_upload, + sc); } @@ -832,4 +850,58 @@ GNUNET_FS_publish_stop (struct GNUNET_FS_PublishContext *sc) } +/** + * Publish a KBlock on GNUnet. + * + * @param h handle to the file sharing subsystem + * @param keyword keyword to use + * @param meta metadata to use + * @param uri URI to refer to in the KBlock + * @param expirationTime when the KBlock expires + * @param anonymity anonymity level for the KBlock + * @param priority priority for the KBlock + */ +// FIXME: cps this one +void +GNUNET_FS_publish_ksk (struct GNUNET_FS_Handle *h, + const char *keyword, + struct GNUNET_CONTAINER_MetaData *meta, + struct GNUNET_FS_Uri *uri, + struct GNUNET_TIME_Absolute expirationTime, + unsigned int anonymity, + unsigned int priority) +{ + // FIXME! +} + + + +/** + * Publish an SBlock on GNUnet. + * + * @param h handle to the file sharing subsystem + * @param namespace namespace to publish in + * @param identifier identifier to use + * @param update update identifier to use + * @param meta metadata to use + * @param uri URI to refer to in the SBlock + * @param expirationTime when the SBlock expires + * @param anonymity anonymity level for the SBlock + * @param priority priority for the SBlock + */ +// FIXME: cps this one +void +GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h, + struct GNUNET_FS_Namespace *namespace, + const char *identifier, + const char *update, + struct GNUNET_CONTAINER_MetaData *meta, + struct GNUNET_FS_Uri *uri, + struct GNUNET_TIME_Absolute expirationTime, + unsigned int anonymity, + unsigned int priority) +{ + // FIXME +} + /* end of fs_publish.c */ diff --git a/src/include/gnunet_fs_service.h b/src/include/gnunet_fs_service.h index 6e18e67c8..2b0880f0d 100644 --- a/src/include/gnunet_fs_service.h +++ b/src/include/gnunet_fs_service.h @@ -1803,6 +1803,54 @@ void GNUNET_FS_publish_stop (struct GNUNET_FS_PublishContext *sc); +/** + * Publish a KBlock on GNUnet. + * + * @param h handle to the file sharing subsystem + * @param keyword keyword to use + * @param meta metadata to use + * @param uri URI to refer to in the KBlock + * @param expirationTime when the KBlock expires + * @param anonymity anonymity level for the KBlock + * @param priority priority for the KBlock + */ +// FIXME: CPS this one.. +void +GNUNET_FS_publish_ksk (struct GNUNET_FS_Handle *h, + const char *keyword, + struct GNUNET_CONTAINER_MetaData *meta, + struct GNUNET_FS_Uri *uri, + struct GNUNET_TIME_Absolute expirationTime, + unsigned int anonymity, + unsigned int priority); + + +/** + * Publish an SBlock on GNUnet. + * + * @param h handle to the file sharing subsystem + * @param namespace namespace to publish in + * @param identifier identifier to use + * @param update update identifier to use + * @param meta metadata to use + * @param uri URI to refer to in the SBlock + * @param expirationTime when the SBlock expires + * @param anonymity anonymity level for the SBlock + * @param priority priority for the SBlock + */ +// FIXME: CPS this one.. +void +GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h, + struct GNUNET_FS_Namespace *namespace, + const char *identifier, + const char *update, + struct GNUNET_CONTAINER_MetaData *meta, + struct GNUNET_FS_Uri *uri, + struct GNUNET_TIME_Absolute expirationTime, + unsigned int anonymity, + unsigned int priority); + + /** * Type of a function called by "GNUNET_FS_get_indexed_files". *