- break;
- case GNUNET_FS_STATUS_PUBLISH_SUSPEND:
- if (event->value.publish.sc == publish)
- publish = NULL;
- break;
- case GNUNET_FS_STATUS_PUBLISH_RESUME:
- if (NULL == publish)
- {
- publish = event->value.publish.sc;
- return "publish-context";
- }
- break;
- case GNUNET_FS_STATUS_UNINDEX_SUSPEND:
- GNUNET_assert (event->value.unindex.uc == unindex);
- unindex = NULL;
- break;
- case GNUNET_FS_STATUS_UNINDEX_RESUME:
- GNUNET_assert (NULL == unindex);
- unindex = event->value.unindex.uc;
- return "unindex";
- 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:
- consider_restart (event->status);
- 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;