aboutsummaryrefslogtreecommitdiff
path: root/src/fs
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-02-09 10:39:16 +0000
committerChristian Grothoff <christian@grothoff.org>2012-02-09 10:39:16 +0000
commiteab56fb5d5d6d5585a7ad7d665adc7c5fb5ec249 (patch)
tree5db9a6156a251cde1932ba221a8990f08f6dcdfe /src/fs
parenta40b3b7045298629783034aba366c609cc04a36a (diff)
downloadgnunet-eab56fb5d5d6d5585a7ad7d665adc7c5fb5ec249.tar.gz
gnunet-eab56fb5d5d6d5585a7ad7d665adc7c5fb5ec249.zip
-fixing #2139
Diffstat (limited to 'src/fs')
-rw-r--r--src/fs/fs_dirmetascan.c3
-rw-r--r--src/fs/gnunet-publish.c30
2 files changed, 26 insertions, 7 deletions
diff --git a/src/fs/fs_dirmetascan.c b/src/fs/fs_dirmetascan.c
index 5b7d2d0c1..1653eebd4 100644
--- a/src/fs/fs_dirmetascan.c
+++ b/src/fs/fs_dirmetascan.c
@@ -92,7 +92,8 @@ struct GNUNET_FS_DirScanner
92 92
93 93
94/** 94/**
95 * Abort the scan. 95 * Abort the scan. Must not be called from within the progress_callback
96 * function.
96 * 97 *
97 * @param ds directory scanner structure 98 * @param ds directory scanner structure
98 */ 99 */
diff --git a/src/fs/gnunet-publish.c b/src/fs/gnunet-publish.c
index 406433a71..370f1062c 100644
--- a/src/fs/gnunet-publish.c
+++ b/src/fs/gnunet-publish.c
@@ -96,6 +96,29 @@ do_stop_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
96 96
97 97
98/** 98/**
99 * Stop the directory scanner (we had an error).
100 *
101 * @param cls closure
102 * @param tc scheduler context
103 */
104static void
105stop_scanner_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
106{
107 kill_task = GNUNET_SCHEDULER_NO_TASK;
108 GNUNET_FS_directory_scan_abort (ds);
109 ds = NULL;
110 if (namespace != NULL)
111 {
112 GNUNET_FS_namespace_delete (namespace, GNUNET_NO);
113 namespace = NULL;
114 }
115 GNUNET_FS_stop (ctx);
116 ctx = NULL;
117 ret = 1;
118}
119
120
121/**
99 * Called by FS client to give information about the progress of an 122 * Called by FS client to give information about the progress of an
100 * operation. 123 * operation.
101 * 124 *
@@ -487,17 +510,12 @@ directory_scan_cb (void *cls,
487 break; 510 break;
488 case GNUNET_FS_DIRSCANNER_INTERNAL_ERROR: 511 case GNUNET_FS_DIRSCANNER_INTERNAL_ERROR:
489 FPRINTF (stdout, "%s", _("Internal error scanning directory.\n")); 512 FPRINTF (stdout, "%s", _("Internal error scanning directory.\n"));
490 GNUNET_FS_directory_scan_abort (ds);
491 ds = NULL;
492 if (namespace != NULL)
493 GNUNET_FS_namespace_delete (namespace, GNUNET_NO);
494 GNUNET_FS_stop (ctx);
495 if (kill_task != GNUNET_SCHEDULER_NO_TASK) 513 if (kill_task != GNUNET_SCHEDULER_NO_TASK)
496 { 514 {
497 GNUNET_SCHEDULER_cancel (kill_task); 515 GNUNET_SCHEDULER_cancel (kill_task);
498 kill_task = GNUNET_SCHEDULER_NO_TASK; 516 kill_task = GNUNET_SCHEDULER_NO_TASK;
499 } 517 }
500 ret = 1; 518 kill_task = GNUNET_SCHEDULER_add_now (&stop_scanner_task, NULL);
501 break; 519 break;
502 default: 520 default:
503 GNUNET_assert (0); 521 GNUNET_assert (0);