+ {
+ case GNUNET_FS_STATUS_PUBLISH_COMPLETED:
+ ret = event->value.publish.cctx;
+ printf ("Publish complete, %llu kbps.\n",
+ (unsigned long long) (FILESIZE * 1000000LL /
+ (1 +
+ GNUNET_TIME_absolute_get_duration
+ (start).rel_value_us) / 1024));
+ if (0 == strcmp ("list_indexed-context-dir", event->value.publish.cctx))
+ GNUNET_SCHEDULER_add_now (&list_indexed_task, NULL);
+
+ break;
+ case GNUNET_FS_STATUS_PUBLISH_PROGRESS:
+ ret = event->value.publish.cctx;
+ GNUNET_assert (publish == event->value.publish.pc);
+ 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:
+ ret = event->value.publish.cctx;
+ break;
+ case GNUNET_FS_STATUS_PUBLISH_ERROR:
+ ret = event->value.publish.cctx;
+ FPRINTF (stderr, "Error publishing file: %s\n",
+ event->value.publish.specifics.error.message);
+ err = 1;
+ if (0 == strcmp ("list_indexed-context-dir", event->value.publish.cctx))
+ GNUNET_SCHEDULER_add_now (&abort_publish_task, NULL);
+ break;
+ case GNUNET_FS_STATUS_PUBLISH_START:
+ ret = event->value.publish.cctx;
+ if (0 == strcmp ("list_indexed-context1", event->value.publish.cctx))
+ {
+ GNUNET_assert (0 ==
+ strcmp ("list_indexed-context-dir",
+ 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);
+ }
+ else if (0 == strcmp ("list_indexed-context2", event->value.publish.cctx))
+ {
+ GNUNET_assert (0 ==
+ strcmp ("list_indexed-context-dir",
+ event->value.publish.pctx));
+ GNUNET_assert (FILESIZE == event->value.publish.size);
+ GNUNET_assert (0 == event->value.publish.completed);
+ GNUNET_assert (2 == event->value.publish.anonymity);
+ }
+ else if (0 ==
+ strcmp ("list_indexed-context-dir", event->value.publish.cctx))
+ {
+ GNUNET_assert (0 == event->value.publish.completed);
+ GNUNET_assert (3 == event->value.publish.anonymity);
+ }
+ else
+ GNUNET_assert (0);
+ break;
+ case GNUNET_FS_STATUS_PUBLISH_STOPPED:
+ if (0 == strcmp ("list_indexed-context-dir", event->value.publish.cctx))