aboutsummaryrefslogtreecommitdiff
path: root/src/fs/fs_publish.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-05-06 06:57:16 +0000
committerChristian Grothoff <christian@grothoff.org>2010-05-06 06:57:16 +0000
commit6ebc869359633883f576a9f23e6ddf6b698eec14 (patch)
tree36cd33df16fcb9535c5293eb1ca927ea3b19b2b1 /src/fs/fs_publish.c
parent4ca6db55581c3ae234743cd5953da49c86ab144d (diff)
downloadgnunet-6ebc869359633883f576a9f23e6ddf6b698eec14.tar.gz
gnunet-6ebc869359633883f576a9f23e6ddf6b698eec14.zip
init top on deserialization
Diffstat (limited to 'src/fs/fs_publish.c')
-rw-r--r--src/fs/fs_publish.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/src/fs/fs_publish.c b/src/fs/fs_publish.c
index 6364dac0a..0ca7cef2d 100644
--- a/src/fs/fs_publish.c
+++ b/src/fs/fs_publish.c
@@ -797,19 +797,19 @@ void
797GNUNET_FS_publish_main_ (void *cls, 797GNUNET_FS_publish_main_ (void *cls,
798 const struct GNUNET_SCHEDULER_TaskContext *tc) 798 const struct GNUNET_SCHEDULER_TaskContext *tc)
799{ 799{
800 struct GNUNET_FS_PublishContext *sc = cls; 800 struct GNUNET_FS_PublishContext *pc = cls;
801 struct GNUNET_FS_ProgressInfo pi; 801 struct GNUNET_FS_ProgressInfo pi;
802 struct GNUNET_FS_FileInformation *p; 802 struct GNUNET_FS_FileInformation *p;
803 char *fn; 803 char *fn;
804 804
805 sc->upload_task = GNUNET_SCHEDULER_NO_TASK; 805 pc->upload_task = GNUNET_SCHEDULER_NO_TASK;
806 p = sc->fi_pos; 806 p = pc->fi_pos;
807 if (NULL == p) 807 if (NULL == p)
808 { 808 {
809 /* upload of entire hierarchy complete, 809 /* upload of entire hierarchy complete,
810 publish namespace entries */ 810 publish namespace entries */
811 GNUNET_FS_publish_sync_ (sc); 811 GNUNET_FS_publish_sync_ (pc);
812 publish_sblock (sc); 812 publish_sblock (pc);
813 return; 813 return;
814 } 814 }
815 /* find starting position */ 815 /* find starting position */
@@ -819,8 +819,8 @@ GNUNET_FS_publish_main_ (void *cls,
819 (NULL == p->data.dir.entries->chk_uri) ) 819 (NULL == p->data.dir.entries->chk_uri) )
820 { 820 {
821 p = p->data.dir.entries; 821 p = p->data.dir.entries;
822 sc->fi_pos = p; 822 pc->fi_pos = p;
823 GNUNET_FS_publish_sync_ (sc); 823 GNUNET_FS_publish_sync_ (pc);
824 } 824 }
825 /* abort on error */ 825 /* abort on error */
826 if (NULL != p->emsg) 826 if (NULL != p->emsg)
@@ -849,33 +849,33 @@ GNUNET_FS_publish_main_ (void *cls,
849 pi.status = GNUNET_FS_STATUS_PUBLISH_ERROR; 849 pi.status = GNUNET_FS_STATUS_PUBLISH_ERROR;
850 pi.value.publish.eta = GNUNET_TIME_UNIT_FOREVER_REL; 850 pi.value.publish.eta = GNUNET_TIME_UNIT_FOREVER_REL;
851 pi.value.publish.specifics.error.message = p->emsg; 851 pi.value.publish.specifics.error.message = p->emsg;
852 p->client_info = GNUNET_FS_publish_make_status_ (&pi, sc, p, 0); 852 p->client_info = GNUNET_FS_publish_make_status_ (&pi, pc, p, 0);
853 } 853 }
854 sc->all_done = GNUNET_YES; 854 pc->all_done = GNUNET_YES;
855 GNUNET_FS_publish_sync_ (sc); 855 GNUNET_FS_publish_sync_ (pc);
856 return; 856 return;
857 } 857 }
858 /* handle completion */ 858 /* handle completion */
859 if (NULL != p->chk_uri) 859 if (NULL != p->chk_uri)
860 { 860 {
861 GNUNET_FS_publish_sync_ (sc); 861 GNUNET_FS_publish_sync_ (pc);
862 /* upload of "p" complete, publish KBlocks! */ 862 /* upload of "p" complete, publish KBlocks! */
863 if (p->keywords != NULL) 863 if (p->keywords != NULL)
864 { 864 {
865 GNUNET_FS_publish_ksk (sc->h, 865 GNUNET_FS_publish_ksk (pc->h,
866 p->keywords, 866 p->keywords,
867 p->meta, 867 p->meta,
868 p->chk_uri, 868 p->chk_uri,
869 p->expirationTime, 869 p->expirationTime,
870 p->anonymity, 870 p->anonymity,
871 p->priority, 871 p->priority,
872 sc->options, 872 pc->options,
873 &publish_kblocks_cont, 873 &publish_kblocks_cont,
874 sc); 874 pc);
875 } 875 }
876 else 876 else
877 { 877 {
878 publish_kblocks_cont (sc, 878 publish_kblocks_cont (pc,
879 p->chk_uri, 879 p->chk_uri,
880 NULL); 880 NULL);
881 } 881 }
@@ -892,27 +892,27 @@ GNUNET_FS_publish_main_ (void *cls,
892 "<no-name>", 892 "<no-name>",
893 _("needs to be an actual file")); 893 _("needs to be an actual file"));
894 GNUNET_FS_file_information_sync_ (p); 894 GNUNET_FS_file_information_sync_ (p);
895 publish_content (sc); 895 publish_content (pc);
896 return; 896 return;
897 } 897 }
898 if (p->data.file.have_hash) 898 if (p->data.file.have_hash)
899 { 899 {
900 hash_for_index_cb (sc, 900 hash_for_index_cb (pc,
901 &p->data.file.file_id); 901 &p->data.file.file_id);
902 } 902 }
903 else 903 else
904 { 904 {
905 p->start_time = GNUNET_TIME_absolute_get (); 905 p->start_time = GNUNET_TIME_absolute_get ();
906 GNUNET_CRYPTO_hash_file (sc->h->sched, 906 GNUNET_CRYPTO_hash_file (pc->h->sched,
907 GNUNET_SCHEDULER_PRIORITY_IDLE, 907 GNUNET_SCHEDULER_PRIORITY_IDLE,
908 p->filename, 908 p->filename,
909 HASHING_BLOCKSIZE, 909 HASHING_BLOCKSIZE,
910 &hash_for_index_cb, 910 &hash_for_index_cb,
911 sc); 911 pc);
912 } 912 }
913 return; 913 return;
914 } 914 }
915 publish_content (sc); 915 publish_content (pc);
916} 916}
917 917
918 918
@@ -998,8 +998,8 @@ fip_signal_suspend(void *cls,
998 * 998 *
999 * @param cls the 'struct GNUNET_FS_PublishContext' to signal for 999 * @param cls the 'struct GNUNET_FS_PublishContext' to signal for
1000 */ 1000 */
1001static void 1001void
1002publish_signal_suspend (void *cls) 1002GNUNET_FS_publish_signal_suspend_ (void *cls)
1003{ 1003{
1004 struct GNUNET_FS_PublishContext *pc = cls; 1004 struct GNUNET_FS_PublishContext *pc = cls;
1005 1005
@@ -1068,7 +1068,7 @@ GNUNET_FS_publish_start (struct GNUNET_FS_Handle *h,
1068 &fip_signal_start, 1068 &fip_signal_start,
1069 ret); 1069 ret);
1070 ret->fi_pos = ret->fi; 1070 ret->fi_pos = ret->fi;
1071 ret->top = GNUNET_FS_make_top (h, &publish_signal_suspend, ret); 1071 ret->top = GNUNET_FS_make_top (h, &GNUNET_FS_publish_signal_suspend_, ret);
1072 GNUNET_FS_publish_sync_ (ret); 1072 GNUNET_FS_publish_sync_ (ret);
1073 // FIXME: calculate space needed for "fi" 1073 // FIXME: calculate space needed for "fi"
1074 // and reserve as first task (then trigger 1074 // and reserve as first task (then trigger