- {
- case GNUNET_FS_STATUS_PUBLISH_PROGRESS:
-#if VERBOSE
- printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n",
- (unsigned long long) event->value.publish.completed,
- (unsigned long long) event->value.publish.size,
- event->value.publish.specifics.progress.depth,
- (unsigned long long) event->value.publish.specifics.progress.offset);
-#endif
- break;
- case GNUNET_FS_STATUS_PUBLISH_COMPLETED:
- printf ("Publishing complete, %llu kbps.\n",
- (unsigned long long) (FILESIZE * 1000 / (1+GNUNET_TIME_absolute_get_duration (start).value) / 1024));
- start = GNUNET_TIME_absolute_get ();
- unindex = GNUNET_FS_unindex_start (fs,
- fn,
- "unindex");
- GNUNET_assert (unindex != NULL);
- break;
- case GNUNET_FS_STATUS_UNINDEX_COMPLETED:
- printf ("Unindex complete, %llu kbps.\n",
- (unsigned long long) (FILESIZE * 1000 / (1+GNUNET_TIME_absolute_get_duration (start).value) / 1024));
- GNUNET_SCHEDULER_add_continuation (sched,
- &abort_unindex_task,
- NULL,
- GNUNET_SCHEDULER_REASON_PREREQ_DONE);
- break;
- case GNUNET_FS_STATUS_UNINDEX_PROGRESS:
- GNUNET_assert (unindex == event->value.unindex.uc);
-#if VERBOSE
- printf ("Unindex is progressing (%llu/%llu at level %u off %llu)...\n",
- (unsigned long long) event->value.unindex.completed,
- (unsigned long long) event->value.unindex.size,
- event->value.unindex.specifics.progress.depth,
- (unsigned long long) event->value.unindex.specifics.progress.offset);
-#endif
- break;
- case GNUNET_FS_STATUS_PUBLISH_ERROR:
- fprintf (stderr,
- "Error publishing file: %s\n",
- event->value.publish.specifics.error.message);
- GNUNET_break (0);
- GNUNET_SCHEDULER_add_continuation (sched,
- &abort_publish_task,
- NULL,
- GNUNET_SCHEDULER_REASON_PREREQ_DONE);
- break;
- case GNUNET_FS_STATUS_UNINDEX_ERROR:
- fprintf (stderr,
- "Error unindexing file: %s\n",
- event->value.unindex.specifics.error.message);
- GNUNET_SCHEDULER_add_continuation (sched,
- &abort_unindex_task,
- NULL,
- GNUNET_SCHEDULER_REASON_PREREQ_DONE);
- break;
- case GNUNET_FS_STATUS_PUBLISH_START:
- GNUNET_assert (0 == strcmp ("publish-context", event->value.publish.cctx));
- GNUNET_assert (NULL == event->value.publish.pctx);
- GNUNET_assert (FILESIZE == event->value.publish.size);
- GNUNET_assert (0 == event->value.publish.completed);
- GNUNET_assert (1 == event->value.publish.anonymity);
- break;
- case GNUNET_FS_STATUS_PUBLISH_STOPPED:
- GNUNET_assert (publish == event->value.publish.sc);
- GNUNET_assert (FILESIZE == event->value.publish.size);
- GNUNET_assert (1 == event->value.publish.anonymity);
- GNUNET_FS_stop (fs);
- fs = NULL;
- break;
- case GNUNET_FS_STATUS_UNINDEX_START:
- GNUNET_assert (unindex == NULL);
- GNUNET_assert (0 == strcmp ("unindex", event->value.unindex.cctx));
- GNUNET_assert (0 == strcmp (fn, event->value.unindex.filename));
- GNUNET_assert (FILESIZE == event->value.unindex.size);
- GNUNET_assert (0 == event->value.unindex.completed);
- break;
- case GNUNET_FS_STATUS_UNINDEX_STOPPED:
- GNUNET_assert (unindex == event->value.unindex.uc);
- GNUNET_SCHEDULER_add_continuation (sched,
- &abort_publish_task,
- NULL,
- GNUNET_SCHEDULER_REASON_PREREQ_DONE);
- break;
- default:
- printf ("Unexpected event: %d\n",
- event->status);
- break;
- }
+ {
+ case GNUNET_FS_STATUS_PUBLISH_PROGRESS:
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Publish is progressing (%llu/%llu at level %u off %llu)...\n",
+ (unsigned long long) event->value.publish.completed,
+ (unsigned long long) event->value.publish.size,
+ event->value.publish.specifics.progress.depth,
+ (unsigned long long) event->value.publish.specifics.
+ progress.offset);
+ break;
+ case GNUNET_FS_STATUS_PUBLISH_PROGRESS_DIRECTORY:
+ break;
+ case GNUNET_FS_STATUS_PUBLISH_COMPLETED:
+ printf ("Publishing complete, %llu kbps.\n",
+ (unsigned long long) (FILESIZE * 1000000LL /
+ (1 +
+ GNUNET_TIME_absolute_get_duration
+ (start).rel_value_us) / 1024));
+ start = GNUNET_TIME_absolute_get ();
+ unindex = GNUNET_FS_unindex_start (fs, fn, "unindex");
+ GNUNET_assert (unindex != NULL);
+ break;
+ case GNUNET_FS_STATUS_UNINDEX_COMPLETED:
+ printf ("Unindex complete, %llu kbps.\n",
+ (unsigned long long) (FILESIZE * 1000000LL /
+ (1 +
+ GNUNET_TIME_absolute_get_duration
+ (start).rel_value_us) / 1024));
+ GNUNET_SCHEDULER_add_continuation (&abort_unindex_task, NULL,
+ GNUNET_SCHEDULER_REASON_PREREQ_DONE);
+ break;
+ case GNUNET_FS_STATUS_UNINDEX_PROGRESS:
+ GNUNET_assert (unindex == event->value.unindex.uc);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Unindex is progressing (%llu/%llu at level %u off %llu)...\n",
+ (unsigned long long) event->value.unindex.completed,
+ (unsigned long long) event->value.unindex.size,
+ event->value.unindex.specifics.progress.depth,
+ (unsigned long long) event->value.unindex.specifics.
+ progress.offset);
+ break;
+ case GNUNET_FS_STATUS_PUBLISH_ERROR:
+ FPRINTF (stderr, "Error publishing file: %s\n",
+ event->value.publish.specifics.error.message);
+ GNUNET_break (0);
+ GNUNET_SCHEDULER_add_continuation (&abort_publish_task, NULL,
+ GNUNET_SCHEDULER_REASON_PREREQ_DONE);
+ break;
+ case GNUNET_FS_STATUS_UNINDEX_ERROR:
+ FPRINTF (stderr, "Error unindexing file: %s\n",
+ event->value.unindex.specifics.error.message);
+ GNUNET_SCHEDULER_add_continuation (&abort_unindex_task, NULL,
+ GNUNET_SCHEDULER_REASON_PREREQ_DONE);
+ break;
+ case GNUNET_FS_STATUS_PUBLISH_START:
+ GNUNET_assert (0 == strcmp ("publish-context", event->value.publish.cctx));
+ GNUNET_assert (NULL == event->value.publish.pctx);
+ GNUNET_assert (FILESIZE == event->value.publish.size);
+ GNUNET_assert (0 == event->value.publish.completed);
+ GNUNET_assert (1 == event->value.publish.anonymity);
+ break;
+ case GNUNET_FS_STATUS_PUBLISH_STOPPED:
+ GNUNET_assert (publish == event->value.publish.pc);
+ GNUNET_assert (FILESIZE == event->value.publish.size);
+ GNUNET_assert (1 == event->value.publish.anonymity);
+ GNUNET_FS_stop (fs);
+ fs = NULL;
+ break;
+ case GNUNET_FS_STATUS_UNINDEX_START:
+ GNUNET_assert (unindex == NULL);
+ GNUNET_assert (0 == strcmp ("unindex", event->value.unindex.cctx));
+ GNUNET_assert (0 == strcmp (fn, event->value.unindex.filename));
+ GNUNET_assert (FILESIZE == event->value.unindex.size);
+ GNUNET_assert (0 == event->value.unindex.completed);
+ break;
+ case GNUNET_FS_STATUS_UNINDEX_STOPPED:
+ GNUNET_assert (unindex == event->value.unindex.uc);
+ GNUNET_SCHEDULER_add_continuation (&abort_publish_task, NULL,
+ GNUNET_SCHEDULER_REASON_PREREQ_DONE);
+ break;
+ default:
+ printf ("Unexpected event: %d\n", event->status);
+ break;
+ }