diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-02-09 10:39:16 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-02-09 10:39:16 +0000 |
commit | eab56fb5d5d6d5585a7ad7d665adc7c5fb5ec249 (patch) | |
tree | 5db9a6156a251cde1932ba221a8990f08f6dcdfe | |
parent | a40b3b7045298629783034aba366c609cc04a36a (diff) | |
download | gnunet-eab56fb5d5d6d5585a7ad7d665adc7c5fb5ec249.tar.gz gnunet-eab56fb5d5d6d5585a7ad7d665adc7c5fb5ec249.zip |
-fixing #2139
-rw-r--r-- | src/fs/fs_dirmetascan.c | 3 | ||||
-rw-r--r-- | src/fs/gnunet-publish.c | 30 | ||||
-rw-r--r-- | src/include/gnunet_fs_service.h | 3 | ||||
-rw-r--r-- | src/util/helper.c | 2 |
4 files changed, 29 insertions, 9 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 | */ | ||
104 | static void | ||
105 | stop_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); |
diff --git a/src/include/gnunet_fs_service.h b/src/include/gnunet_fs_service.h index 454a5c953..9707a8eb7 100644 --- a/src/include/gnunet_fs_service.h +++ b/src/include/gnunet_fs_service.h | |||
@@ -2725,7 +2725,8 @@ GNUNET_FS_directory_scan_start (const char *filename, | |||
2725 | 2725 | ||
2726 | 2726 | ||
2727 | /** | 2727 | /** |
2728 | * Abort the scan. | 2728 | * Abort the scan. Must not be called from within the progress_callback |
2729 | * function. | ||
2729 | * | 2730 | * |
2730 | * @param ds directory scanner structure | 2731 | * @param ds directory scanner structure |
2731 | */ | 2732 | */ |
diff --git a/src/util/helper.c b/src/util/helper.c index d9458aedb..e5d336e2f 100644 --- a/src/util/helper.c +++ b/src/util/helper.c | |||
@@ -194,7 +194,7 @@ stop_helper (struct GNUNET_HELPER_Handle *h) | |||
194 | GNUNET_free (qe); | 194 | GNUNET_free (qe); |
195 | } | 195 | } |
196 | /* purge MST buffer */ | 196 | /* purge MST buffer */ |
197 | GNUNET_SERVER_mst_receive (h->mst, NULL, NULL, 0, GNUNET_YES, GNUNET_NO); | 197 | (void) GNUNET_SERVER_mst_receive (h->mst, NULL, NULL, 0, GNUNET_YES, GNUNET_NO); |
198 | } | 198 | } |
199 | 199 | ||
200 | 200 | ||