aboutsummaryrefslogtreecommitdiff
path: root/src/fs/test_fs_publish.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-05-06 13:30:17 +0000
committerChristian Grothoff <christian@grothoff.org>2010-05-06 13:30:17 +0000
commitae7bfd97da823c4fb870dbe5c68231a4ab2a85d8 (patch)
treec12de941417e85259089d933684803476f9222d1 /src/fs/test_fs_publish.c
parent0ce4db5534d634cca6dc001eae43a8907e9c5cf2 (diff)
downloadgnunet-ae7bfd97da823c4fb870dbe5c68231a4ab2a85d8.tar.gz
gnunet-ae7bfd97da823c4fb870dbe5c68231a4ab2a85d8.zip
fixing publish persist test
Diffstat (limited to 'src/fs/test_fs_publish.c')
-rw-r--r--src/fs/test_fs_publish.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/src/fs/test_fs_publish.c b/src/fs/test_fs_publish.c
index 20e65aeac..7df42a26f 100644
--- a/src/fs/test_fs_publish.c
+++ b/src/fs/test_fs_publish.c
@@ -67,8 +67,6 @@ static struct GNUNET_FS_Handle *fs;
67 67
68static struct GNUNET_FS_PublishContext *publish; 68static struct GNUNET_FS_PublishContext *publish;
69 69
70static struct GNUNET_FS_PublishContext *publish;
71
72static char *fn1; 70static char *fn1;
73 71
74static char *fn2; 72static char *fn2;
@@ -103,12 +101,12 @@ progress_cb (void *cls,
103 ret = event->value.publish.cctx; 101 ret = event->value.publish.cctx;
104 printf ("Publish complete, %llu kbps.\n", 102 printf ("Publish complete, %llu kbps.\n",
105 (unsigned long long) (FILESIZE * 1000 / (1+GNUNET_TIME_absolute_get_duration (start).value) / 1024)); 103 (unsigned long long) (FILESIZE * 1000 / (1+GNUNET_TIME_absolute_get_duration (start).value) / 1024));
106 if (0 == strcmp ("list_indexed-context-dir", 104 if (0 == strcmp ("publish-context-dir",
107 event->value.publish.cctx)) 105 event->value.publish.cctx))
108 GNUNET_SCHEDULER_add_continuation (sched, 106 GNUNET_SCHEDULER_add_continuation (sched,
109 &abort_publish_task, 107 &abort_publish_task,
110 NULL, 108 NULL,
111 GNUNET_SCHEDULER_REASON_PREREQ_DONE); 109 GNUNET_SCHEDULER_REASON_PREREQ_DONE);
112 break; 110 break;
113 case GNUNET_FS_STATUS_PUBLISH_PROGRESS: 111 case GNUNET_FS_STATUS_PUBLISH_PROGRESS:
114 ret = event->value.publish.cctx; 112 ret = event->value.publish.cctx;
@@ -127,12 +125,16 @@ progress_cb (void *cls,
127 "Error publishing file: %s\n", 125 "Error publishing file: %s\n",
128 event->value.publish.specifics.error.message); 126 event->value.publish.specifics.error.message);
129 err = 1; 127 err = 1;
130 if (0 == strcmp ("list_indexed-context-dir", 128 if (0 == strcmp ("publish-context-dir",
131 event->value.publish.cctx)) 129 event->value.publish.cctx))
132 GNUNET_SCHEDULER_add_continuation (sched, 130 {
133 &abort_publish_task, 131 fprintf (stderr, "Scheduling abort task for error on `%s'\n",
134 NULL, 132 (const char*) event->value.publish.cctx);
135 GNUNET_SCHEDULER_REASON_PREREQ_DONE); 133 GNUNET_SCHEDULER_add_continuation (sched,
134 &abort_publish_task,
135 NULL,
136 GNUNET_SCHEDULER_REASON_PREREQ_DONE);
137 }
136 break; 138 break;
137 case GNUNET_FS_STATUS_PUBLISH_START: 139 case GNUNET_FS_STATUS_PUBLISH_START:
138 ret = event->value.publish.cctx; 140 ret = event->value.publish.cctx;
@@ -164,15 +166,9 @@ progress_cb (void *cls,
164 GNUNET_assert (0); 166 GNUNET_assert (0);
165 break; 167 break;
166 case GNUNET_FS_STATUS_PUBLISH_STOPPED: 168 case GNUNET_FS_STATUS_PUBLISH_STOPPED:
167 if (0 == strcmp ("list_indexed-context-dir", 169 if (0 == strcmp ("publish-context-dir",
168 event->value.publish.cctx)) 170 event->value.publish.cctx))
169 { 171 GNUNET_assert (publish == event->value.publish.sc);
170 GNUNET_assert (publish == event->value.publish.sc);
171 GNUNET_SCHEDULER_add_continuation (sched,
172 &abort_publish_task,
173 NULL,
174 GNUNET_SCHEDULER_REASON_PREREQ_DONE);
175 }
176 break; 172 break;
177 default: 173 default:
178 printf ("Unexpected event: %d\n", 174 printf ("Unexpected event: %d\n",