aboutsummaryrefslogtreecommitdiff
path: root/src/fs/fs_namespace.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-12-19 13:54:35 +0000
committerChristian Grothoff <christian@grothoff.org>2011-12-19 13:54:35 +0000
commitbf2d1ccefd7b5bd13295733a36bf19afba46f4b2 (patch)
treec440a5bcf7e328d1dd05dd3b1a5def173adb49df /src/fs/fs_namespace.c
parent1997d2d086b237e2688d12567933a53b2229ea26 (diff)
downloadgnunet-bf2d1ccefd7b5bd13295733a36bf19afba46f4b2.tar.gz
gnunet-bf2d1ccefd7b5bd13295733a36bf19afba46f4b2.zip
adding min_expiration argument to GNUNET_DATASTORE_ContinuationWithStatus callback to communicate which content has a chance of being stored in the medium term
Diffstat (limited to 'src/fs/fs_namespace.c')
-rw-r--r--src/fs/fs_namespace.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/fs/fs_namespace.c b/src/fs/fs_namespace.c
index 9d754009b..ec4e2495a 100644
--- a/src/fs/fs_namespace.c
+++ b/src/fs/fs_namespace.c
@@ -311,10 +311,13 @@ do_disconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
311 * 311 *
312 * @param cls closure (our struct AdvertismentContext) 312 * @param cls closure (our struct AdvertismentContext)
313 * @param success GNUNET_SYSERR on failure 313 * @param success GNUNET_SYSERR on failure
314 * @param min_expiration minimum expiration time required for content to be stored
314 * @param msg NULL on success, otherwise an error message 315 * @param msg NULL on success, otherwise an error message
315 */ 316 */
316static void 317static void
317advertisement_cont (void *cls, int success, const char *msg) 318advertisement_cont (void *cls, int success,
319 struct GNUNET_TIME_Absolute min_expiration,
320 const char *msg)
318{ 321{
319 struct AdvertisementContext *ac = cls; 322 struct AdvertisementContext *ac = cls;
320 const char *keyword; 323 const char *keyword;
@@ -475,7 +478,7 @@ GNUNET_FS_namespace_advertise (struct GNUNET_FS_Handle *h,
475 ctx->ns = namespace; 478 ctx->ns = namespace;
476 ctx->ns->rc++; 479 ctx->ns->rc++;
477 ctx->bo = *bo; 480 ctx->bo = *bo;
478 advertisement_cont (ctx, GNUNET_OK, NULL); 481 advertisement_cont (ctx, GNUNET_OK, GNUNET_TIME_UNIT_ZERO_ABS, NULL);
479} 482}
480 483
481 484
@@ -697,10 +700,13 @@ struct PublishSksContext
697 * 700 *
698 * @param cls closure of type "struct PublishSksContext*" 701 * @param cls closure of type "struct PublishSksContext*"
699 * @param success GNUNET_OK on success 702 * @param success GNUNET_OK on success
703 * @param min_expiration minimum expiration time required for content to be stored
700 * @param msg error message (or NULL) 704 * @param msg error message (or NULL)
701 */ 705 */
702static void 706static void
703sb_put_cont (void *cls, int success, const char *msg) 707sb_put_cont (void *cls, int success,
708 struct GNUNET_TIME_Absolute min_expiration,
709 const char *msg)
704{ 710{
705 struct PublishSksContext *psc = cls; 711 struct PublishSksContext *psc = cls;
706 GNUNET_HashCode hc; 712 GNUNET_HashCode hc;
@@ -867,7 +873,7 @@ GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h,
867 { 873 {
868 GNUNET_free (sb_enc); 874 GNUNET_free (sb_enc);
869 GNUNET_free (sb); 875 GNUNET_free (sb);
870 sb_put_cont (psc, GNUNET_OK, NULL); 876 sb_put_cont (psc, GNUNET_OK, GNUNET_TIME_UNIT_ZERO_ABS, NULL);
871 return; 877 return;
872 } 878 }
873 psc->dsh = GNUNET_DATASTORE_connect (h->cfg); 879 psc->dsh = GNUNET_DATASTORE_connect (h->cfg);
@@ -875,7 +881,7 @@ GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h,
875 { 881 {
876 GNUNET_free (sb_enc); 882 GNUNET_free (sb_enc);
877 GNUNET_free (sb); 883 GNUNET_free (sb);
878 sb_put_cont (psc, GNUNET_NO, _("Failed to connect to datastore.")); 884 sb_put_cont (psc, GNUNET_NO, GNUNET_TIME_UNIT_ZERO_ABS, _("Failed to connect to datastore."));
879 return; 885 return;
880 } 886 }
881 GNUNET_CRYPTO_hash_xor (&sks_uri->data.sks.namespace, &id, &query); 887 GNUNET_CRYPTO_hash_xor (&sks_uri->data.sks.namespace, &id, &query);