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.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/src/fs/fs_publish.c b/src/fs/fs_publish.c
index 0d2dae283..387ede6a1 100644
--- a/src/fs/fs_publish.c
+++ b/src/fs/fs_publish.c
@@ -112,7 +112,7 @@ publish_cleanup (struct GNUNET_FS_PublishContext *pc)
112 * @param msg error message (or NULL) 112 * @param msg error message (or NULL)
113 */ 113 */
114static void 114static void
115ds_put_cont (void *cls, int success, 115ds_put_cont (void *cls, int success,
116 struct GNUNET_TIME_Absolute min_expiration, 116 struct GNUNET_TIME_Absolute min_expiration,
117 const char *msg) 117 const char *msg)
118{ 118{
@@ -206,14 +206,14 @@ signal_publish_error (struct GNUNET_FS_FileInformation *p,
206 * @param msg error message (typically NULL, not used) 206 * @param msg error message (typically NULL, not used)
207 */ 207 */
208static void 208static void
209finish_release_reserve (void *cls, int success, 209finish_release_reserve (void *cls, int success,
210 struct GNUNET_TIME_Absolute min_expiration, 210 struct GNUNET_TIME_Absolute min_expiration,
211 const char *msg) 211 const char *msg)
212{ 212{
213 struct GNUNET_FS_PublishContext *pc = cls; 213 struct GNUNET_FS_PublishContext *pc = cls;
214 214
215 pc->qre = NULL; 215 pc->qre = NULL;
216 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 216 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
217 "Releasing reserve done!\n"); 217 "Releasing reserve done!\n");
218 signal_publish_completion (pc->fi, pc); 218 signal_publish_completion (pc->fi, pc);
219 pc->all_done = GNUNET_YES; 219 pc->all_done = GNUNET_YES;
@@ -268,8 +268,8 @@ publish_sblock (struct GNUNET_FS_PublishContext *pc)
268{ 268{
269 if (NULL != pc->ns) 269 if (NULL != pc->ns)
270 pc->sks_pc = GNUNET_FS_publish_sks (pc->h, 270 pc->sks_pc = GNUNET_FS_publish_sks (pc->h,
271 pc->ns, 271 pc->ns,
272 pc->nid, 272 pc->nid,
273 pc->nuid, 273 pc->nuid,
274 pc->fi->meta, 274 pc->fi->meta,
275 pc->fi->chk_uri, 275 pc->fi->chk_uri,
@@ -300,7 +300,7 @@ publish_kblocks_cont (void *cls, const struct GNUNET_FS_Uri *uri,
300 pc->ksk_pc = NULL; 300 pc->ksk_pc = NULL;
301 if (NULL != emsg) 301 if (NULL != emsg)
302 { 302 {
303 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 303 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
304 "Error uploading KSK blocks: %s\n", 304 "Error uploading KSK blocks: %s\n",
305 emsg); 305 emsg);
306 signal_publish_error (p, pc, emsg); 306 signal_publish_error (p, pc, emsg);
@@ -359,7 +359,7 @@ block_reader (void *cls, uint64_t offset, size_t max, void *buf, char **emsg)
359 } 359 }
360 else 360 else
361 { 361 {
362 if (UINT64_MAX == offset) 362 if (UINT64_MAX == offset)
363 { 363 {
364 if (&GNUNET_FS_data_reader_file_ == p->data.file.reader) 364 if (&GNUNET_FS_data_reader_file_ == p->data.file.reader)
365 { 365 {
@@ -408,10 +408,10 @@ encode_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
408 if (NULL != emsg) 408 if (NULL != emsg)
409 { 409 {
410 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 410 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
411 "Error during tree walk: %s\n", 411 "Error during tree walk: %s\n",
412 emsg); 412 emsg);
413 GNUNET_asprintf (&p->emsg, 413 GNUNET_asprintf (&p->emsg,
414 _("Publishing failed: %s"), 414 _("Publishing failed: %s"),
415 emsg); 415 emsg);
416 GNUNET_free (emsg); 416 GNUNET_free (emsg);
417 pi.status = GNUNET_FS_STATUS_PUBLISH_ERROR; 417 pi.status = GNUNET_FS_STATUS_PUBLISH_ERROR;
@@ -603,7 +603,7 @@ publish_content (struct GNUNET_FS_PublishContext *pc)
603 GNUNET_FS_file_information_sync_ (p); 603 GNUNET_FS_file_information_sync_ (p);
604 } 604 }
605 size = (GNUNET_YES == p->is_directory) ? p->data.dir.dir_size : p->data.file.file_size; 605 size = (GNUNET_YES == p->is_directory) ? p->data.dir.dir_size : p->data.file.file_size;
606 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 606 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
607 "Creating tree encoder\n"); 607 "Creating tree encoder\n");
608 p->te = 608 p->te =
609 GNUNET_FS_tree_encoder_create (pc->h, size, pc, &block_reader, 609 GNUNET_FS_tree_encoder_create (pc->h, size, pc, &block_reader,
@@ -625,7 +625,7 @@ publish_content (struct GNUNET_FS_PublishContext *pc)
625 * @param msg the response we got 625 * @param msg the response we got
626 */ 626 */
627static void 627static void
628process_index_start_response (void *cls, 628process_index_start_response (void *cls,
629 const struct GNUNET_MessageHeader *msg) 629 const struct GNUNET_MessageHeader *msg)
630{ 630{
631 struct GNUNET_FS_PublishContext *pc = cls; 631 struct GNUNET_FS_PublishContext *pc = cls;
@@ -696,7 +696,7 @@ hash_for_index_cb (void *cls,
696 { 696 {
697 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 697 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
698 _("Can not index file `%s': %s. Will try to insert instead.\n"), 698 _("Can not index file `%s': %s. Will try to insert instead.\n"),
699 p->filename, 699 p->filename,
700 _("failed to compute hash")); 700 _("failed to compute hash"));
701 p->data.file.do_index = GNUNET_NO; 701 p->data.file.do_index = GNUNET_NO;
702 GNUNET_FS_file_information_sync_ (p); 702 GNUNET_FS_file_information_sync_ (p);
@@ -741,7 +741,7 @@ hash_for_index_cb (void *cls,
741 { 741 {
742 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 742 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
743 _("Can not index file `%s': %s. Will try to insert instead.\n"), 743 _("Can not index file `%s': %s. Will try to insert instead.\n"),
744 p->filename, 744 p->filename,
745 _("could not connect to `fs' service")); 745 _("could not connect to `fs' service"));
746 p->data.file.do_index = GNUNET_NO; 746 p->data.file.do_index = GNUNET_NO;
747 publish_content (pc); 747 publish_content (pc);
@@ -810,8 +810,8 @@ GNUNET_FS_publish_main_ (void *cls,
810 return; 810 return;
811 } 811 }
812 /* find starting position */ 812 /* find starting position */
813 while ( (GNUNET_YES == p->is_directory) && 813 while ( (GNUNET_YES == p->is_directory) &&
814 (NULL != p->data.dir.entries) && 814 (NULL != p->data.dir.entries) &&
815 (NULL == p->emsg) && 815 (NULL == p->emsg) &&
816 (NULL == p->data.dir.entries->chk_uri) ) 816 (NULL == p->data.dir.entries->chk_uri) )
817 { 817 {
@@ -822,8 +822,8 @@ GNUNET_FS_publish_main_ (void *cls,
822 /* abort on error */ 822 /* abort on error */
823 if (NULL != p->emsg) 823 if (NULL != p->emsg)
824 { 824 {
825 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 825 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
826 "Error uploading: %s\n", 826 "Error uploading: %s\n",
827 p->emsg); 827 p->emsg);
828 /* error with current file, abort all 828 /* error with current file, abort all
829 * related files as well! */ 829 * related files as well! */
@@ -928,9 +928,9 @@ fip_signal_start (void *cls,
928 struct GNUNET_FS_FileInformation *fi, 928 struct GNUNET_FS_FileInformation *fi,
929 uint64_t length, 929 uint64_t length,
930 struct GNUNET_CONTAINER_MetaData *meta, 930 struct GNUNET_CONTAINER_MetaData *meta,
931 struct GNUNET_FS_Uri **uri, 931 struct GNUNET_FS_Uri **uri,
932 struct GNUNET_FS_BlockOptions *bo, 932 struct GNUNET_FS_BlockOptions *bo,
933 int *do_index, 933 int *do_index,
934 void **client_info) 934 void **client_info)
935{ 935{
936 struct GNUNET_FS_PublishContext *pc = cls; 936 struct GNUNET_FS_PublishContext *pc = cls;
@@ -1013,7 +1013,7 @@ suspend_operation (struct GNUNET_FS_FileInformation *fi,
1013 GNUNET_FS_publish_sks_cancel (pc->sks_pc); 1013 GNUNET_FS_publish_sks_cancel (pc->sks_pc);
1014 pc->sks_pc = NULL; 1014 pc->sks_pc = NULL;
1015 } 1015 }
1016 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1016 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1017 "Suspending publish operation\n"); 1017 "Suspending publish operation\n");
1018 GNUNET_free_non_null (fi->serialization); 1018 GNUNET_free_non_null (fi->serialization);
1019 fi->serialization = NULL; 1019 fi->serialization = NULL;
@@ -1051,10 +1051,10 @@ suspend_operation (struct GNUNET_FS_FileInformation *fi,
1051static int 1051static int
1052fip_signal_suspend (void *cls, 1052fip_signal_suspend (void *cls,
1053 struct GNUNET_FS_FileInformation *fi, 1053 struct GNUNET_FS_FileInformation *fi,
1054 uint64_t length, 1054 uint64_t length,
1055 struct GNUNET_CONTAINER_MetaData *meta, 1055 struct GNUNET_CONTAINER_MetaData *meta,
1056 struct GNUNET_FS_Uri **uri, 1056 struct GNUNET_FS_Uri **uri,
1057 struct GNUNET_FS_BlockOptions *bo, 1057 struct GNUNET_FS_BlockOptions *bo,
1058 int *do_index, 1058 int *do_index,
1059 void **client_info) 1059 void **client_info)
1060{ 1060{
@@ -1112,7 +1112,7 @@ GNUNET_FS_publish_signal_suspend_ (void *cls)
1112 * @param msg error message on error, otherwise NULL 1112 * @param msg error message on error, otherwise NULL
1113 */ 1113 */
1114static void 1114static void
1115finish_reserve (void *cls, int success, 1115finish_reserve (void *cls, int success,
1116 struct GNUNET_TIME_Absolute min_expiration, 1116 struct GNUNET_TIME_Absolute min_expiration,
1117 const char *msg) 1117 const char *msg)
1118{ 1118{
@@ -1122,7 +1122,7 @@ finish_reserve (void *cls, int success,
1122 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Reservation complete (%d)!\n", success); 1122 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Reservation complete (%d)!\n", success);
1123 if ((msg != NULL) || (success <= 0)) 1123 if ((msg != NULL) || (success <= 0))
1124 { 1124 {
1125 GNUNET_asprintf (&pc->fi->emsg, 1125 GNUNET_asprintf (&pc->fi->emsg,
1126 _("Insufficient space for publishing: %s"), 1126 _("Insufficient space for publishing: %s"),
1127 msg); 1127 msg);
1128 signal_publish_error (pc->fi, pc, pc->fi->emsg); 1128 signal_publish_error (pc->fi, pc, pc->fi->emsg);