- ret = event->value.publish.cctx;
- if (0 == strcmp ("publish-context1",
- event->value.publish.cctx))
- {
- GNUNET_assert (0 == strcmp ("publish-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 ("publish-context2",
- event->value.publish.cctx))
- {
- GNUNET_assert (0 == strcmp ("publish-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 ("publish-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:
- consider_restart (event->status);
- if (0 == strcmp ("publish-context-dir",
- event->value.publish.cctx))
- GNUNET_assert (publish == event->value.publish.pc);
- break;
- default:
- printf ("Unexpected event: %d\n",
- event->status);
- break;
+ return "publish-context-dir";
+ }
+ 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;
+ GNUNET_SCHEDULER_add_now (&abort_publish_task, NULL);
+ break;
+ case GNUNET_FS_STATUS_PUBLISH_START:
+ consider_restart (event->status);
+ publish = event->value.publish.pc;
+ ret = event->value.publish.cctx;
+ if (0 == strcmp ("publish-context1", event->value.publish.cctx))
+ {
+ GNUNET_assert (0 ==
+ strcmp ("publish-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 ("publish-context2", event->value.publish.cctx))
+ {
+ GNUNET_assert (0 ==
+ strcmp ("publish-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 ("publish-context-dir", event->value.publish.cctx))
+ {
+ GNUNET_assert (0 == event->value.publish.completed);
+ GNUNET_assert (3 == event->value.publish.anonymity);