diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-05-03 21:35:44 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-05-03 21:35:44 +0000 |
commit | 7eb4b4b3ab14ef6433b08cca8c673d00f8405062 (patch) | |
tree | 04dfe48fe96a0a8096239b0083f19602b333a998 /src/fs/fs_publish.c | |
parent | 4092583a7dcb0844d5957909ef81f6766b3f2603 (diff) | |
download | gnunet-7eb4b4b3ab14ef6433b08cca8c673d00f8405062.tar.gz gnunet-7eb4b4b3ab14ef6433b08cca8c673d00f8405062.zip |
towards suspend
Diffstat (limited to 'src/fs/fs_publish.c')
-rw-r--r-- | src/fs/fs_publish.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/fs/fs_publish.c b/src/fs/fs_publish.c index c4dbe624e..4101174bb 100644 --- a/src/fs/fs_publish.c +++ b/src/fs/fs_publish.c | |||
@@ -930,6 +930,22 @@ fip_signal_start(void *cls, | |||
930 | 930 | ||
931 | 931 | ||
932 | /** | 932 | /** |
933 | * Create SUSPEND event for the given publish operation | ||
934 | * and then clean up our state (without stop signal). | ||
935 | * | ||
936 | * @param cls the 'struct GNUNET_FS_PublishContext' to signal for | ||
937 | */ | ||
938 | static void | ||
939 | publish_signal_suspend (void *cls) | ||
940 | { | ||
941 | struct GNUNET_FS_PublishContext *pc = cls; | ||
942 | |||
943 | GNUNET_FS_end_top (pc->h, pc->top); | ||
944 | /* FIXME: signal! */ | ||
945 | GNUNET_free (pc); | ||
946 | } | ||
947 | |||
948 | /** | ||
933 | * Publish a file or directory. | 949 | * Publish a file or directory. |
934 | * | 950 | * |
935 | * @param h handle to the file sharing subsystem | 951 | * @param h handle to the file sharing subsystem |
@@ -983,7 +999,7 @@ GNUNET_FS_publish_start (struct GNUNET_FS_Handle *h, | |||
983 | &fip_signal_start, | 999 | &fip_signal_start, |
984 | ret); | 1000 | ret); |
985 | ret->fi_pos = ret->fi; | 1001 | ret->fi_pos = ret->fi; |
986 | 1002 | ret->top = GNUNET_FS_make_top (h, &publish_signal_suspend, ret); | |
987 | // FIXME: calculate space needed for "fi" | 1003 | // FIXME: calculate space needed for "fi" |
988 | // and reserve as first task (then trigger | 1004 | // and reserve as first task (then trigger |
989 | // "publish_main" from that continuation)! | 1005 | // "publish_main" from that continuation)! |
@@ -1056,6 +1072,7 @@ fip_signal_stop(void *cls, | |||
1056 | void | 1072 | void |
1057 | GNUNET_FS_publish_stop (struct GNUNET_FS_PublishContext *pc) | 1073 | GNUNET_FS_publish_stop (struct GNUNET_FS_PublishContext *pc) |
1058 | { | 1074 | { |
1075 | GNUNET_FS_end_top (pc->h, pc->top); | ||
1059 | if (GNUNET_SCHEDULER_NO_TASK != pc->upload_task) | 1076 | if (GNUNET_SCHEDULER_NO_TASK != pc->upload_task) |
1060 | GNUNET_SCHEDULER_cancel (pc->h->sched, pc->upload_task); | 1077 | GNUNET_SCHEDULER_cancel (pc->h->sched, pc->upload_task); |
1061 | if (pc->serialization != NULL) | 1078 | if (pc->serialization != NULL) |