static struct GNUNET_FS_PublishContext *publish;
-static struct GNUNET_FS_PublishContext *publish;
-
static char *fn1;
static char *fn2;
ret = event->value.publish.cctx;
printf ("Publish complete, %llu kbps.\n",
(unsigned long long) (FILESIZE * 1000 / (1+GNUNET_TIME_absolute_get_duration (start).value) / 1024));
- if (0 == strcmp ("list_indexed-context-dir",
+ if (0 == strcmp ("publish-context-dir",
event->value.publish.cctx))
GNUNET_SCHEDULER_add_continuation (sched,
&abort_publish_task,
NULL,
- GNUNET_SCHEDULER_REASON_PREREQ_DONE);
+ GNUNET_SCHEDULER_REASON_PREREQ_DONE);
break;
case GNUNET_FS_STATUS_PUBLISH_PROGRESS:
ret = event->value.publish.cctx;
"Error publishing file: %s\n",
event->value.publish.specifics.error.message);
err = 1;
- if (0 == strcmp ("list_indexed-context-dir",
+ if (0 == strcmp ("publish-context-dir",
event->value.publish.cctx))
- GNUNET_SCHEDULER_add_continuation (sched,
- &abort_publish_task,
- NULL,
- GNUNET_SCHEDULER_REASON_PREREQ_DONE);
+ {
+ fprintf (stderr, "Scheduling abort task for error on `%s'\n",
+ (const char*) event->value.publish.cctx);
+ GNUNET_SCHEDULER_add_continuation (sched,
+ &abort_publish_task,
+ NULL,
+ GNUNET_SCHEDULER_REASON_PREREQ_DONE);
+ }
break;
case GNUNET_FS_STATUS_PUBLISH_START:
ret = event->value.publish.cctx;
GNUNET_assert (0);
break;
case GNUNET_FS_STATUS_PUBLISH_STOPPED:
- if (0 == strcmp ("list_indexed-context-dir",
+ if (0 == strcmp ("publish-context-dir",
event->value.publish.cctx))
- {
- GNUNET_assert (publish == event->value.publish.sc);
- GNUNET_SCHEDULER_add_continuation (sched,
- &abort_publish_task,
- NULL,
- GNUNET_SCHEDULER_REASON_PREREQ_DONE);
- }
+ GNUNET_assert (publish == event->value.publish.sc);
break;
default:
printf ("Unexpected event: %d\n",
ret = event->value.publish.cctx;
printf ("Publish complete, %llu kbps.\n",
(unsigned long long) (FILESIZE * 1000 / (1+GNUNET_TIME_absolute_get_duration (start).value) / 1024));
- if (0 == strcmp ("list_indexed-context-dir",
+ if (0 == strcmp ("publish-context-dir",
event->value.publish.cctx))
GNUNET_SCHEDULER_add_continuation (sched,
&abort_publish_task,
(unsigned long long) event->value.publish.specifics.progress.offset);
#endif
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-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;
- if (0 == strcmp ("list_indexed-context-dir",
+ if (0 == strcmp ("publish-context-dir",
event->value.publish.cctx))
GNUNET_SCHEDULER_add_continuation (sched,
&abort_publish_task,
break;
case GNUNET_FS_STATUS_PUBLISH_START:
consider_restart (event->status);
+ publish = event->value.publish.sc;
ret = event->value.publish.cctx;
if (0 == strcmp ("publish-context1",
event->value.publish.cctx))
break;
case GNUNET_FS_STATUS_PUBLISH_STOPPED:
consider_restart (event->status);
- if (0 == strcmp ("list_indexed-context-dir",
+ if (0 == strcmp ("publish-context-dir",
event->value.publish.cctx))
- {
- GNUNET_assert (publish == event->value.publish.sc);
- GNUNET_SCHEDULER_add_continuation (sched,
- &abort_publish_task,
- NULL,
- GNUNET_SCHEDULER_REASON_PREREQ_DONE);
- }
+ GNUNET_assert (publish == event->value.publish.sc);
break;
default:
printf ("Unexpected event: %d\n",
GNUNET_CONTAINER_meta_data_destroy (meta);
GNUNET_assert (NULL != fidir);
start = GNUNET_TIME_absolute_get ();
- publish = GNUNET_FS_publish_start (fs,
- fidir,
- NULL, NULL, NULL,
- GNUNET_FS_PUBLISH_OPTION_NONE);
+ GNUNET_FS_publish_start (fs,
+ fidir,
+ NULL, NULL, NULL,
+ GNUNET_FS_PUBLISH_OPTION_NONE);
GNUNET_assert (publish != NULL);
}