-fix error handling during publishing
authorChristian Grothoff <christian@grothoff.org>
Sat, 24 Mar 2012 18:53:22 +0000 (18:53 +0000)
committerChristian Grothoff <christian@grothoff.org>
Sat, 24 Mar 2012 18:53:22 +0000 (18:53 +0000)
src/fs/fs_publish.c
src/fs/fs_tree.c

index 1657e29e19c64c123c3cdf7c3d58a1735edc4202..4f84db767a77211affe5f0c2145c0edc13411e33 100644 (file)
@@ -388,7 +388,6 @@ encode_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
   p = pc->fi_pos;
   GNUNET_FS_tree_encoder_finish (p->te, &p->chk_uri, &emsg);
   p->te = NULL;
-  GNUNET_FS_file_information_sync_ (p);
   if (NULL != emsg)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Error during tree walk: %s\n", emsg);
@@ -399,6 +398,7 @@ encode_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
     pi.value.publish.specifics.error.message = p->emsg;
     p->client_info = GNUNET_FS_publish_make_status_ (&pi, pc, p, 0);
   }
+  GNUNET_FS_file_information_sync_ (p);
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Finished with tree encoder\n");
   /* final progress event */
   flen = GNUNET_FS_uri_chk_get_file_size (p->chk_uri);
index a055bcd40a990f785e320d91be39498cf5038717..2bdf8a062fddd9a23130d4369b08aa008da0fa45 100644 (file)
@@ -361,8 +361,8 @@ GNUNET_FS_tree_encoder_next (struct GNUNET_FS_TreeEncoder *te)
     if (pt_size !=
         te->reader (te->cls, te->publish_offset, pt_size, iob, &te->emsg))
     {
-      te->cont (te->cls, NULL);
       te->in_next = GNUNET_NO;
+      te->cont (te->cls, NULL);
       return;
     }
     pt_block = iob;