diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-03-24 18:54:40 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-03-24 18:54:40 +0000 |
commit | b78e4f20e152830ca627ffc4735621f9b5b6929d (patch) | |
tree | 55dd49026cfe4b4c7a6e2423635417b4e3de4f08 /src/fs/fs_publish.c | |
parent | b54431c5e7d54dc8c4e124e8cc5bde26d2c8b0b2 (diff) | |
download | gnunet-b78e4f20e152830ca627ffc4735621f9b5b6929d.tar.gz gnunet-b78e4f20e152830ca627ffc4735621f9b5b6929d.zip |
-fix error handling during publishing
Diffstat (limited to 'src/fs/fs_publish.c')
-rw-r--r-- | src/fs/fs_publish.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/fs/fs_publish.c b/src/fs/fs_publish.c index 4f84db767..b3f6415c8 100644 --- a/src/fs/fs_publish.c +++ b/src/fs/fs_publish.c | |||
@@ -385,6 +385,7 @@ encode_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
385 | char *emsg; | 385 | char *emsg; |
386 | uint64_t flen; | 386 | uint64_t flen; |
387 | 387 | ||
388 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Finished with tree encoder\n"); | ||
388 | p = pc->fi_pos; | 389 | p = pc->fi_pos; |
389 | GNUNET_FS_tree_encoder_finish (p->te, &p->chk_uri, &emsg); | 390 | GNUNET_FS_tree_encoder_finish (p->te, &p->chk_uri, &emsg); |
390 | p->te = NULL; | 391 | p->te = NULL; |
@@ -398,17 +399,19 @@ encode_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
398 | pi.value.publish.specifics.error.message = p->emsg; | 399 | pi.value.publish.specifics.error.message = p->emsg; |
399 | p->client_info = GNUNET_FS_publish_make_status_ (&pi, pc, p, 0); | 400 | p->client_info = GNUNET_FS_publish_make_status_ (&pi, pc, p, 0); |
400 | } | 401 | } |
401 | GNUNET_FS_file_information_sync_ (p); | 402 | else |
402 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Finished with tree encoder\n"); | 403 | { |
403 | /* final progress event */ | 404 | /* final progress event */ |
404 | flen = GNUNET_FS_uri_chk_get_file_size (p->chk_uri); | 405 | GNUNET_assert (NULL != p->chk_uri); |
405 | pi.status = GNUNET_FS_STATUS_PUBLISH_PROGRESS; | 406 | flen = GNUNET_FS_uri_chk_get_file_size (p->chk_uri); |
406 | pi.value.publish.specifics.progress.data = NULL; | 407 | pi.status = GNUNET_FS_STATUS_PUBLISH_PROGRESS; |
407 | pi.value.publish.specifics.progress.offset = flen; | 408 | pi.value.publish.specifics.progress.data = NULL; |
408 | pi.value.publish.specifics.progress.data_len = 0; | 409 | pi.value.publish.specifics.progress.offset = flen; |
409 | pi.value.publish.specifics.progress.depth = GNUNET_FS_compute_depth (flen); | 410 | pi.value.publish.specifics.progress.data_len = 0; |
410 | p->client_info = GNUNET_FS_publish_make_status_ (&pi, pc, p, flen); | 411 | pi.value.publish.specifics.progress.depth = GNUNET_FS_compute_depth (flen); |
411 | 412 | p->client_info = GNUNET_FS_publish_make_status_ (&pi, pc, p, flen); | |
413 | } | ||
414 | GNUNET_FS_file_information_sync_ (p); | ||
412 | /* continue with main */ | 415 | /* continue with main */ |
413 | GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == pc->upload_task); | 416 | GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == pc->upload_task); |
414 | pc->upload_task = | 417 | pc->upload_task = |