aboutsummaryrefslogtreecommitdiff
path: root/src/fs/fs_publish.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-02-05 18:48:20 +0000
committerChristian Grothoff <christian@grothoff.org>2012-02-05 18:48:20 +0000
commit0b7df31372e4eb63732f03f8754607a4dee2b80d (patch)
treeea63e528453ebd648da94c22f85aceff2382c2a5 /src/fs/fs_publish.c
parentf535d34e1403ed6c7d612f77ef594f56651e786b (diff)
downloadgnunet-0b7df31372e4eb63732f03f8754607a4dee2b80d.tar.gz
gnunet-0b7df31372e4eb63732f03f8754607a4dee2b80d.zip
-fix generation of duplicate publish-stop events
Diffstat (limited to 'src/fs/fs_publish.c')
-rw-r--r--src/fs/fs_publish.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/fs/fs_publish.c b/src/fs/fs_publish.c
index f25987723..3c5e87edb 100644
--- a/src/fs/fs_publish.c
+++ b/src/fs/fs_publish.c
@@ -1264,6 +1264,9 @@ fip_signal_stop (void *cls, struct GNUNET_FS_FileInformation *fi,
1264void 1264void
1265GNUNET_FS_publish_stop (struct GNUNET_FS_PublishContext *pc) 1265GNUNET_FS_publish_stop (struct GNUNET_FS_PublishContext *pc)
1266{ 1266{
1267 struct GNUNET_FS_ProgressInfo pi;
1268 uint64_t off;
1269
1267#if DEBUG_PUBLISH 1270#if DEBUG_PUBLISH
1268 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Publish stop called\n"); 1271 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Publish stop called\n");
1269#endif 1272#endif
@@ -1283,6 +1286,20 @@ GNUNET_FS_publish_stop (struct GNUNET_FS_PublishContext *pc)
1283 GNUNET_SCHEDULER_cancel (pc->upload_task); 1286 GNUNET_SCHEDULER_cancel (pc->upload_task);
1284 pc->upload_task = GNUNET_SCHEDULER_NO_TASK; 1287 pc->upload_task = GNUNET_SCHEDULER_NO_TASK;
1285 } 1288 }
1289 pc->skip_next_fi_callback = GNUNET_YES;
1290 GNUNET_FS_file_information_inspect (pc->fi, &fip_signal_stop, pc);
1291
1292 if (pc->fi->serialization != NULL)
1293 {
1294 GNUNET_FS_remove_sync_file_ (pc->h, GNUNET_FS_SYNC_PATH_FILE_INFO,
1295 pc->fi->serialization);
1296 GNUNET_free (pc->fi->serialization);
1297 pc->fi->serialization = NULL;
1298 }
1299 off = (pc->fi->chk_uri == NULL) ? 0 : GNUNET_ntohll (pc->fi->chk_uri->data.chk.file_length);
1300 pi.status = GNUNET_FS_STATUS_PUBLISH_STOPPED;
1301 GNUNET_break (NULL == GNUNET_FS_publish_make_status_ (&pi, pc, pc->fi, off));
1302
1286 if (pc->serialization != NULL) 1303 if (pc->serialization != NULL)
1287 { 1304 {
1288 GNUNET_FS_remove_sync_file_ (pc->h, GNUNET_FS_SYNC_PATH_MASTER_PUBLISH, 1305 GNUNET_FS_remove_sync_file_ (pc->h, GNUNET_FS_SYNC_PATH_MASTER_PUBLISH,
@@ -1290,7 +1307,6 @@ GNUNET_FS_publish_stop (struct GNUNET_FS_PublishContext *pc)
1290 GNUNET_free (pc->serialization); 1307 GNUNET_free (pc->serialization);
1291 pc->serialization = NULL; 1308 pc->serialization = NULL;
1292 } 1309 }
1293 GNUNET_FS_file_information_inspect (pc->fi, &fip_signal_stop, pc);
1294 if (GNUNET_YES == pc->in_network_wait) 1310 if (GNUNET_YES == pc->in_network_wait)
1295 { 1311 {
1296 pc->in_network_wait = GNUNET_SYSERR; 1312 pc->in_network_wait = GNUNET_SYSERR;