diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-05-06 20:28:21 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-05-06 20:28:21 +0000 |
commit | 1e94a424f360666f438064901fa9a800aa6e383e (patch) | |
tree | 98e03f29ba5cc8eea920042c2b637c440d1ded44 /src/fs/test_fs_unindex_persistence.c | |
parent | 7db4f64461a77f19bb39f1b84d26f96e6acf40ab (diff) | |
download | gnunet-1e94a424f360666f438064901fa9a800aa6e383e.tar.gz gnunet-1e94a424f360666f438064901fa9a800aa6e383e.zip |
fix unindex persistence
Diffstat (limited to 'src/fs/test_fs_unindex_persistence.c')
-rw-r--r-- | src/fs/test_fs_unindex_persistence.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/fs/test_fs_unindex_persistence.c b/src/fs/test_fs_unindex_persistence.c index c964004c1..2185be21d 100644 --- a/src/fs/test_fs_unindex_persistence.c +++ b/src/fs/test_fs_unindex_persistence.c | |||
@@ -161,7 +161,6 @@ progress_cb (void *cls, | |||
161 | GNUNET_assert (unindex != NULL); | 161 | GNUNET_assert (unindex != NULL); |
162 | break; | 162 | break; |
163 | case GNUNET_FS_STATUS_UNINDEX_COMPLETED: | 163 | case GNUNET_FS_STATUS_UNINDEX_COMPLETED: |
164 | consider_restart (event->status); | ||
165 | printf ("Unindex complete, %llu kbps.\n", | 164 | printf ("Unindex complete, %llu kbps.\n", |
166 | (unsigned long long) (FILESIZE * 1000 / (1+GNUNET_TIME_absolute_get_duration (start).value) / 1024)); | 165 | (unsigned long long) (FILESIZE * 1000 / (1+GNUNET_TIME_absolute_get_duration (start).value) / 1024)); |
167 | GNUNET_SCHEDULER_add_continuation (sched, | 166 | GNUNET_SCHEDULER_add_continuation (sched, |
@@ -180,6 +179,25 @@ progress_cb (void *cls, | |||
180 | (unsigned long long) event->value.unindex.specifics.progress.offset); | 179 | (unsigned long long) event->value.unindex.specifics.progress.offset); |
181 | #endif | 180 | #endif |
182 | break; | 181 | break; |
182 | case GNUNET_FS_STATUS_PUBLISH_SUSPEND: | ||
183 | if (event->value.publish.sc == publish) | ||
184 | publish = NULL; | ||
185 | break; | ||
186 | case GNUNET_FS_STATUS_PUBLISH_RESUME: | ||
187 | if (NULL == publish) | ||
188 | { | ||
189 | publish = event->value.publish.sc; | ||
190 | return "publish-context"; | ||
191 | } | ||
192 | break; | ||
193 | case GNUNET_FS_STATUS_UNINDEX_SUSPEND: | ||
194 | GNUNET_assert (event->value.unindex.uc == unindex); | ||
195 | unindex = NULL; | ||
196 | break; | ||
197 | case GNUNET_FS_STATUS_UNINDEX_RESUME: | ||
198 | GNUNET_assert (NULL == unindex); | ||
199 | unindex = event->value.unindex.uc; | ||
200 | return "unindex"; | ||
183 | case GNUNET_FS_STATUS_PUBLISH_ERROR: | 201 | case GNUNET_FS_STATUS_PUBLISH_ERROR: |
184 | fprintf (stderr, | 202 | fprintf (stderr, |
185 | "Error publishing file: %s\n", | 203 | "Error publishing file: %s\n", |
@@ -222,7 +240,6 @@ progress_cb (void *cls, | |||
222 | GNUNET_assert (0 == event->value.unindex.completed); | 240 | GNUNET_assert (0 == event->value.unindex.completed); |
223 | break; | 241 | break; |
224 | case GNUNET_FS_STATUS_UNINDEX_STOPPED: | 242 | case GNUNET_FS_STATUS_UNINDEX_STOPPED: |
225 | consider_restart (event->status); | ||
226 | GNUNET_assert (unindex == event->value.unindex.uc); | 243 | GNUNET_assert (unindex == event->value.unindex.uc); |
227 | GNUNET_SCHEDULER_add_continuation (sched, | 244 | GNUNET_SCHEDULER_add_continuation (sched, |
228 | &abort_publish_task, | 245 | &abort_publish_task, |