diff options
-rw-r--r-- | TODO | 5 | ||||
-rw-r--r-- | src/fs/Makefile.am | 1 | ||||
-rw-r--r-- | src/fs/fs.h | 27 | ||||
-rw-r--r-- | src/fs/fs_search.c | 18 | ||||
-rw-r--r-- | src/fs/test_fs_namespace.c | 5 |
5 files changed, 40 insertions, 16 deletions
@@ -27,13 +27,10 @@ away), in order in which they will likely be done: | |||
27 | - utilization can (easily, restart?) go out of control (very large), causing | 27 | - utilization can (easily, restart?) go out of control (very large), causing |
28 | content expiration job to go crazy and delete everything! | 28 | content expiration job to go crazy and delete everything! |
29 | * FS: | 29 | * FS: |
30 | ! fs_search test fails (hangs) since blocktype was changed from "ANY" to "KBLOCK"! | ||
31 | (insert blocktype wrong? or what!?) | ||
32 | ! fs_namespace test fails (hangs), but local fs service has found results; somehow | ||
33 | they are not passed to the client and/or the shutdown sequence is not working | ||
34 | - gnunet-publish cannot be aborted using CTRL-C | 30 | - gnunet-publish cannot be aborted using CTRL-C |
35 | - on some systems, keyword search does not find locally published content | 31 | - on some systems, keyword search does not find locally published content |
36 | (need testcase of command-line tools! - also good to cover getopt API!) | 32 | (need testcase of command-line tools! - also good to cover getopt API!) |
33 | [could be related to datastore issue above!] | ||
37 | - 2-peer download is still too slow (why?) | 34 | - 2-peer download is still too slow (why?) |
38 | - advanced FS API parts | 35 | - advanced FS API parts |
39 | + search: SBlocks, NBlocks, probes, notify FS-service of known results | 36 | + search: SBlocks, NBlocks, probes, notify FS-service of known results |
diff --git a/src/fs/Makefile.am b/src/fs/Makefile.am index 4a11d4ddf..a83eef460 100644 --- a/src/fs/Makefile.am +++ b/src/fs/Makefile.am | |||
@@ -134,6 +134,7 @@ TESTS = \ | |||
134 | test_fs_download \ | 134 | test_fs_download \ |
135 | test_fs_file_information \ | 135 | test_fs_file_information \ |
136 | test_fs_list_indexed \ | 136 | test_fs_list_indexed \ |
137 | test_fs_namespace \ | ||
137 | test_fs_publish \ | 138 | test_fs_publish \ |
138 | test_fs_search \ | 139 | test_fs_search \ |
139 | test_fs_start_stop \ | 140 | test_fs_start_stop \ |
diff --git a/src/fs/fs.h b/src/fs/fs.h index b7fab55f0..e3b3bc99d 100644 --- a/src/fs/fs.h +++ b/src/fs/fs.h | |||
@@ -815,6 +815,33 @@ struct GNUNET_FS_SearchContext | |||
815 | struct GNUNET_FS_SearchContext *parent; | 815 | struct GNUNET_FS_SearchContext *parent; |
816 | 816 | ||
817 | /** | 817 | /** |
818 | * For update-searches, link to the | ||
819 | * first child search that triggered the | ||
820 | * update search; otherwise NULL. | ||
821 | */ | ||
822 | struct GNUNET_FS_SearchContext *child_head; | ||
823 | |||
824 | /** | ||
825 | * For update-searches, link to the | ||
826 | * last child search that triggered the | ||
827 | * update search; otherwise NULL. | ||
828 | */ | ||
829 | struct GNUNET_FS_SearchContext *child_tail; | ||
830 | |||
831 | /** | ||
832 | * For update-searches, link to the | ||
833 | * next child belonging to the same parent. | ||
834 | */ | ||
835 | struct GNUNET_FS_SearchContext *next; | ||
836 | |||
837 | /** | ||
838 | * For update-searches, link to the | ||
839 | * previous child belonging to the same | ||
840 | * parent. | ||
841 | */ | ||
842 | struct GNUNET_FS_SearchContext *prev; | ||
843 | |||
844 | /** | ||
818 | * Connection to the FS service. | 845 | * Connection to the FS service. |
819 | */ | 846 | */ |
820 | struct GNUNET_CLIENT_Connection *client; | 847 | struct GNUNET_CLIENT_Connection *client; |
diff --git a/src/fs/fs_search.c b/src/fs/fs_search.c index 3b90338af..98168c3f4 100644 --- a/src/fs/fs_search.c +++ b/src/fs/fs_search.c | |||
@@ -812,10 +812,9 @@ search_start (struct GNUNET_FS_Handle *h, | |||
812 | } | 812 | } |
813 | } | 813 | } |
814 | if (NULL != parent) | 814 | if (NULL != parent) |
815 | { | 815 | GNUNET_CONTAINER_DLL_insert (parent->child_head, |
816 | // FIXME: need to track children | 816 | parent->child_tail, |
817 | // in parent in case parent is stopped! | 817 | sc); |
818 | } | ||
819 | pi.status = GNUNET_FS_STATUS_SEARCH_START; | 818 | pi.status = GNUNET_FS_STATUS_SEARCH_START; |
820 | make_search_status (&pi, sc); | 819 | make_search_status (&pi, sc); |
821 | sc->client_info = h->upcb (h->upcb_cls, | 820 | sc->client_info = h->upcb (h->upcb_cls, |
@@ -955,13 +954,18 @@ GNUNET_FS_search_stop (struct GNUNET_FS_SearchContext *sc) | |||
955 | { | 954 | { |
956 | struct GNUNET_FS_ProgressInfo pi; | 955 | struct GNUNET_FS_ProgressInfo pi; |
957 | unsigned int i; | 956 | unsigned int i; |
957 | struct GNUNET_FS_SearchContext *parent; | ||
958 | 958 | ||
959 | // FIXME: make un-persistent! | 959 | // FIXME: make un-persistent! |
960 | if (NULL != sc->parent) | 960 | if (NULL != (parent = sc->parent)) |
961 | { | 961 | { |
962 | // FIXME: need to untrack sc | 962 | GNUNET_CONTAINER_DLL_remove (parent->child_head, |
963 | // in parent! | 963 | parent->child_tail, |
964 | sc); | ||
965 | sc->parent = NULL; | ||
964 | } | 966 | } |
967 | while (NULL != sc->child_head) | ||
968 | GNUNET_FS_search_stop (sc->child_head); | ||
965 | GNUNET_CONTAINER_multihashmap_iterate (sc->master_result_map, | 969 | GNUNET_CONTAINER_multihashmap_iterate (sc->master_result_map, |
966 | &search_result_free, | 970 | &search_result_free, |
967 | sc); | 971 | sc); |
diff --git a/src/fs/test_fs_namespace.c b/src/fs/test_fs_namespace.c index 2284f3cef..a7ccbeccf 100644 --- a/src/fs/test_fs_namespace.c +++ b/src/fs/test_fs_namespace.c | |||
@@ -23,9 +23,6 @@ | |||
23 | * @brief Test for fs_namespace.c | 23 | * @brief Test for fs_namespace.c |
24 | * @author Christian Grothoff | 24 | * @author Christian Grothoff |
25 | * | 25 | * |
26 | * | ||
27 | * FIXME: | ||
28 | * - child search of "sks" search (the "next" identifier) is not stopped => no termination! | ||
29 | * TODO: | 26 | * TODO: |
30 | * - add timeout task | 27 | * - add timeout task |
31 | */ | 28 | */ |
@@ -220,8 +217,6 @@ progress_cb (void *cls, | |||
220 | case GNUNET_FS_STATUS_SEARCH_STOPPED: | 217 | case GNUNET_FS_STATUS_SEARCH_STOPPED: |
221 | fprintf (stderr, | 218 | fprintf (stderr, |
222 | "Search stop event received\n"); | 219 | "Search stop event received\n"); |
223 | GNUNET_assert ( (ksk_search == event->value.search.sc) || | ||
224 | (sks_search == event->value.search.sc)); | ||
225 | return NULL; | 220 | return NULL; |
226 | default: | 221 | default: |
227 | fprintf (stderr, | 222 | fprintf (stderr, |