aboutsummaryrefslogtreecommitdiff
path: root/src/fs/fs_publish.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs/fs_publish.c')
-rw-r--r--src/fs/fs_publish.c82
1 files changed, 27 insertions, 55 deletions
diff --git a/src/fs/fs_publish.c b/src/fs/fs_publish.c
index ac69c94a1..36efb27f6 100644
--- a/src/fs/fs_publish.c
+++ b/src/fs/fs_publish.c
@@ -95,7 +95,7 @@ GNUNET_FS_publish_make_status_ (struct GNUNET_FS_ProgressInfo *pi,
95 pi->value.publish.size); 95 pi->value.publish.size);
96 pi->value.publish.completed = offset; 96 pi->value.publish.completed = offset;
97 pi->value.publish.duration = GNUNET_TIME_absolute_get_duration (p->start_time); 97 pi->value.publish.duration = GNUNET_TIME_absolute_get_duration (p->start_time);
98 pi->value.publish.anonymity = p->anonymity; 98 pi->value.publish.anonymity = p->bo.anonymity_level;
99 return sc->h->upcb (sc->h->upcb_cls, 99 return sc->h->upcb (sc->h->upcb_cls,
100 pi); 100 pi);
101} 101}
@@ -324,9 +324,7 @@ publish_sblock (struct GNUNET_FS_PublishContext *sc)
324 sc->nuid, 324 sc->nuid,
325 sc->fi->meta, 325 sc->fi->meta,
326 sc->fi->chk_uri, 326 sc->fi->chk_uri,
327 sc->fi->expirationTime, 327 &sc->fi->bo,
328 sc->fi->anonymity,
329 sc->fi->priority,
330 sc->options, 328 sc->options,
331 &publish_sblocks_cont, 329 &publish_sblocks_cont,
332 sc); 330 sc);
@@ -569,9 +567,10 @@ block_proc (void *cls,
569 sizeof (struct OnDemandBlock), 567 sizeof (struct OnDemandBlock),
570 &odb, 568 &odb,
571 GNUNET_BLOCK_TYPE_FS_ONDEMAND, 569 GNUNET_BLOCK_TYPE_FS_ONDEMAND,
572 p->priority, 570 p->bo.content_priority,
573 p->anonymity, 571 p->bo.anonymity_level,
574 p->expirationTime, 572 p->bo.replication_level,
573 p->bo.expiration_time,
575 -2, 1, 574 -2, 1,
576 GNUNET_CONSTANTS_SERVICE_TIMEOUT, 575 GNUNET_CONSTANTS_SERVICE_TIMEOUT,
577 &ds_put_cont, 576 &ds_put_cont,
@@ -591,9 +590,10 @@ block_proc (void *cls,
591 block_size, 590 block_size,
592 block, 591 block,
593 type, 592 type,
594 p->priority, 593 p->bo.content_priority,
595 p->anonymity, 594 p->bo.anonymity_level,
596 p->expirationTime, 595 p->bo.replication_level,
596 p->bo.expiration_time,
597 -2, 1, 597 -2, 1,
598 GNUNET_CONSTANTS_SERVICE_TIMEOUT, 598 GNUNET_CONSTANTS_SERVICE_TIMEOUT,
599 &ds_put_cont, 599 &ds_put_cont,
@@ -990,12 +990,12 @@ GNUNET_FS_publish_main_ (void *cls,
990 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 990 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
991 "File upload complete, now publishing KSK blocks.\n"); 991 "File upload complete, now publishing KSK blocks.\n");
992#endif 992#endif
993 if (0 == p->anonymity) 993 if (0 == p->bo.anonymity_level)
994 { 994 {
995 /* zero anonymity, box CHK URI in LOC URI */ 995 /* zero anonymity, box CHK URI in LOC URI */
996 loc = GNUNET_FS_uri_loc_create (p->chk_uri, 996 loc = GNUNET_FS_uri_loc_create (p->chk_uri,
997 pc->h->cfg, 997 pc->h->cfg,
998 p->expirationTime); 998 p->bo.expiration_time);
999 GNUNET_FS_uri_destroy (p->chk_uri); 999 GNUNET_FS_uri_destroy (p->chk_uri);
1000 p->chk_uri = loc; 1000 p->chk_uri = loc;
1001 } 1001 }
@@ -1007,9 +1007,7 @@ GNUNET_FS_publish_main_ (void *cls,
1007 p->keywords, 1007 p->keywords,
1008 p->meta, 1008 p->meta,
1009 p->chk_uri, 1009 p->chk_uri,
1010 p->expirationTime, 1010 &p->bo,
1011 p->anonymity,
1012 p->priority,
1013 pc->options, 1011 pc->options,
1014 &publish_kblocks_cont, 1012 &publish_kblocks_cont,
1015 pc); 1013 pc);
@@ -1065,10 +1063,8 @@ GNUNET_FS_publish_main_ (void *cls,
1065 * @param length length of the file or directory 1063 * @param length length of the file or directory
1066 * @param meta metadata for the file or directory (can be modified) 1064 * @param meta metadata for the file or directory (can be modified)
1067 * @param uri pointer to the keywords that will be used for this entry (can be modified) 1065 * @param uri pointer to the keywords that will be used for this entry (can be modified)
1068 * @param anonymity pointer to selected anonymity level (can be modified) 1066 * @param bo block options
1069 * @param priority pointer to selected priority (can be modified)
1070 * @param do_index should we index? 1067 * @param do_index should we index?
1071 * @param expirationTime pointer to selected expiration time (can be modified)
1072 * @param client_info pointer to client context set upon creation (can be modified) 1068 * @param client_info pointer to client context set upon creation (can be modified)
1073 * @return GNUNET_OK to continue (always) 1069 * @return GNUNET_OK to continue (always)
1074 */ 1070 */
@@ -1078,10 +1074,8 @@ fip_signal_start(void *cls,
1078 uint64_t length, 1074 uint64_t length,
1079 struct GNUNET_CONTAINER_MetaData *meta, 1075 struct GNUNET_CONTAINER_MetaData *meta,
1080 struct GNUNET_FS_Uri **uri, 1076 struct GNUNET_FS_Uri **uri,
1081 uint32_t *anonymity, 1077 struct GNUNET_FS_BlockOptions *bo,
1082 uint32_t *priority,
1083 int *do_index, 1078 int *do_index,
1084 struct GNUNET_TIME_Absolute *expirationTime,
1085 void **client_info) 1079 void **client_info)
1086{ 1080{
1087 struct GNUNET_FS_PublishContext *sc = cls; 1081 struct GNUNET_FS_PublishContext *sc = cls;
@@ -1134,10 +1128,8 @@ fip_signal_start(void *cls,
1134 * @param length length of the file or directory 1128 * @param length length of the file or directory
1135 * @param meta metadata for the file or directory (can be modified) 1129 * @param meta metadata for the file or directory (can be modified)
1136 * @param uri pointer to the keywords that will be used for this entry (can be modified) 1130 * @param uri pointer to the keywords that will be used for this entry (can be modified)
1137 * @param anonymity pointer to selected anonymity level (can be modified) 1131 * @param bo block options
1138 * @param priority pointer to selected priority (can be modified)
1139 * @param do_index should we index? 1132 * @param do_index should we index?
1140 * @param expirationTime pointer to selected expiration time (can be modified)
1141 * @param client_info pointer to client context set upon creation (can be modified) 1133 * @param client_info pointer to client context set upon creation (can be modified)
1142 * @return GNUNET_OK to continue (always) 1134 * @return GNUNET_OK to continue (always)
1143 */ 1135 */
@@ -1147,10 +1139,8 @@ fip_signal_suspend(void *cls,
1147 uint64_t length, 1139 uint64_t length,
1148 struct GNUNET_CONTAINER_MetaData *meta, 1140 struct GNUNET_CONTAINER_MetaData *meta,
1149 struct GNUNET_FS_Uri **uri, 1141 struct GNUNET_FS_Uri **uri,
1150 uint32_t *anonymity, 1142 struct GNUNET_FS_BlockOptions *bo,
1151 uint32_t *priority,
1152 int *do_index, 1143 int *do_index,
1153 struct GNUNET_TIME_Absolute *expirationTime,
1154 void **client_info) 1144 void **client_info)
1155{ 1145{
1156 struct GNUNET_FS_PublishContext*sc = cls; 1146 struct GNUNET_FS_PublishContext*sc = cls;
@@ -1322,10 +1312,8 @@ GNUNET_FS_publish_start (struct GNUNET_FS_Handle *h,
1322 * @param length length of the file or directory 1312 * @param length length of the file or directory
1323 * @param meta metadata for the file or directory (can be modified) 1313 * @param meta metadata for the file or directory (can be modified)
1324 * @param uri pointer to the keywords that will be used for this entry (can be modified) 1314 * @param uri pointer to the keywords that will be used for this entry (can be modified)
1325 * @param anonymity pointer to selected anonymity level (can be modified) 1315 * @param bo block options (can be modified)
1326 * @param priority pointer to selected priority (can be modified)
1327 * @param do_index should we index? 1316 * @param do_index should we index?
1328 * @param expirationTime pointer to selected expiration time (can be modified)
1329 * @param client_info pointer to client context set upon creation (can be modified) 1317 * @param client_info pointer to client context set upon creation (can be modified)
1330 * @return GNUNET_OK to continue (always) 1318 * @return GNUNET_OK to continue (always)
1331 */ 1319 */
@@ -1335,10 +1323,8 @@ fip_signal_stop(void *cls,
1335 uint64_t length, 1323 uint64_t length,
1336 struct GNUNET_CONTAINER_MetaData *meta, 1324 struct GNUNET_CONTAINER_MetaData *meta,
1337 struct GNUNET_FS_Uri **uri, 1325 struct GNUNET_FS_Uri **uri,
1338 uint32_t *anonymity, 1326 struct GNUNET_FS_BlockOptions *bo,
1339 uint32_t *priority,
1340 int *do_index, 1327 int *do_index,
1341 struct GNUNET_TIME_Absolute *expirationTime,
1342 void **client_info) 1328 void **client_info)
1343{ 1329{
1344 struct GNUNET_FS_PublishContext*sc = cls; 1330 struct GNUNET_FS_PublishContext*sc = cls;
@@ -1454,7 +1440,7 @@ struct PublishKskContext
1454 /** 1440 /**
1455 * When should the KBlocks expire? 1441 * When should the KBlocks expire?
1456 */ 1442 */
1457 struct GNUNET_TIME_Absolute expirationTime; 1443 struct GNUNET_FS_BlockOptions bo;
1458 1444
1459 /** 1445 /**
1460 * Size of the serialized metadata. 1446 * Size of the serialized metadata.
@@ -1471,15 +1457,6 @@ struct PublishKskContext
1471 */ 1457 */
1472 unsigned int i; 1458 unsigned int i;
1473 1459
1474 /**
1475 * Anonymity level for the KBlocks.
1476 */
1477 uint32_t anonymity;
1478
1479 /**
1480 * Priority for the KBlocks.
1481 */
1482 uint32_t priority;
1483}; 1460};
1484 1461
1485 1462
@@ -1604,9 +1581,10 @@ publish_ksk_cont (void *cls,
1604 pkc->slen, 1581 pkc->slen,
1605 pkc->cpy, 1582 pkc->cpy,
1606 GNUNET_BLOCK_TYPE_FS_KBLOCK, 1583 GNUNET_BLOCK_TYPE_FS_KBLOCK,
1607 pkc->priority, 1584 pkc->bo.content_priority,
1608 pkc->anonymity, 1585 pkc->bo.anonymity_level,
1609 pkc->expirationTime, 1586 pkc->bo.replication_level,
1587 pkc->bo.expiration_time,
1610 -2, 1, 1588 -2, 1,
1611 GNUNET_CONSTANTS_SERVICE_TIMEOUT, 1589 GNUNET_CONSTANTS_SERVICE_TIMEOUT,
1612 &kb_put_cont, 1590 &kb_put_cont,
@@ -1621,9 +1599,7 @@ publish_ksk_cont (void *cls,
1621 * @param ksk_uri keywords to use 1599 * @param ksk_uri keywords to use
1622 * @param meta metadata to use 1600 * @param meta metadata to use
1623 * @param uri URI to refer to in the KBlock 1601 * @param uri URI to refer to in the KBlock
1624 * @param expirationTime when the KBlock expires 1602 * @param bo per-block options
1625 * @param anonymity anonymity level for the KBlock
1626 * @param priority priority for the KBlock
1627 * @param options publication options 1603 * @param options publication options
1628 * @param cont continuation 1604 * @param cont continuation
1629 * @param cont_cls closure for cont 1605 * @param cont_cls closure for cont
@@ -1633,9 +1609,7 @@ GNUNET_FS_publish_ksk (struct GNUNET_FS_Handle *h,
1633 const struct GNUNET_FS_Uri *ksk_uri, 1609 const struct GNUNET_FS_Uri *ksk_uri,
1634 const struct GNUNET_CONTAINER_MetaData *meta, 1610 const struct GNUNET_CONTAINER_MetaData *meta,
1635 const struct GNUNET_FS_Uri *uri, 1611 const struct GNUNET_FS_Uri *uri,
1636 struct GNUNET_TIME_Absolute expirationTime, 1612 const struct GNUNET_FS_BlockOptions *bo,
1637 uint32_t anonymity,
1638 uint32_t priority,
1639 enum GNUNET_FS_PublishOptions options, 1613 enum GNUNET_FS_PublishOptions options,
1640 GNUNET_FS_PublishContinuation cont, 1614 GNUNET_FS_PublishContinuation cont,
1641 void *cont_cls) 1615 void *cont_cls)
@@ -1649,9 +1623,7 @@ GNUNET_FS_publish_ksk (struct GNUNET_FS_Handle *h,
1649 GNUNET_assert (NULL != uri); 1623 GNUNET_assert (NULL != uri);
1650 pkc = GNUNET_malloc (sizeof (struct PublishKskContext)); 1624 pkc = GNUNET_malloc (sizeof (struct PublishKskContext));
1651 pkc->h = h; 1625 pkc->h = h;
1652 pkc->expirationTime = expirationTime; 1626 pkc->bo = *bo;
1653 pkc->anonymity = anonymity;
1654 pkc->priority = priority;
1655 pkc->cont = cont; 1627 pkc->cont = cont;
1656 pkc->cont_cls = cont_cls; 1628 pkc->cont_cls = cont_cls;
1657 if (0 == (options & GNUNET_FS_PUBLISH_OPTION_SIMULATE_ONLY)) 1629 if (0 == (options & GNUNET_FS_PUBLISH_OPTION_SIMULATE_ONLY))