From: Christian Grothoff Date: Tue, 30 Mar 2010 06:52:25 +0000 (+0000) Subject: stuff X-Git-Tag: initial-import-from-subversion-38251~22354 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=ec55bba59025e6a6ff25c950184c836e12855847;p=oweals%2Fgnunet.git stuff --- diff --git a/TODO b/TODO index 20bd3cceb..37621af31 100644 --- a/TODO +++ b/TODO @@ -27,13 +27,10 @@ away), in order in which they will likely be done: - utilization can (easily, restart?) go out of control (very large), causing content expiration job to go crazy and delete everything! * FS: - ! fs_search test fails (hangs) since blocktype was changed from "ANY" to "KBLOCK"! - (insert blocktype wrong? or what!?) - ! fs_namespace test fails (hangs), but local fs service has found results; somehow - they are not passed to the client and/or the shutdown sequence is not working - gnunet-publish cannot be aborted using CTRL-C - on some systems, keyword search does not find locally published content (need testcase of command-line tools! - also good to cover getopt API!) + [could be related to datastore issue above!] - 2-peer download is still too slow (why?) - advanced FS API parts + 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 = \ test_fs_download \ test_fs_file_information \ test_fs_list_indexed \ + test_fs_namespace \ test_fs_publish \ test_fs_search \ 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 @@ -814,6 +814,33 @@ struct GNUNET_FS_SearchContext */ struct GNUNET_FS_SearchContext *parent; + /** + * For update-searches, link to the + * first child search that triggered the + * update search; otherwise NULL. + */ + struct GNUNET_FS_SearchContext *child_head; + + /** + * For update-searches, link to the + * last child search that triggered the + * update search; otherwise NULL. + */ + struct GNUNET_FS_SearchContext *child_tail; + + /** + * For update-searches, link to the + * next child belonging to the same parent. + */ + struct GNUNET_FS_SearchContext *next; + + /** + * For update-searches, link to the + * previous child belonging to the same + * parent. + */ + struct GNUNET_FS_SearchContext *prev; + /** * Connection to the FS service. */ 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, } } if (NULL != parent) - { - // FIXME: need to track children - // in parent in case parent is stopped! - } + GNUNET_CONTAINER_DLL_insert (parent->child_head, + parent->child_tail, + sc); pi.status = GNUNET_FS_STATUS_SEARCH_START; make_search_status (&pi, sc); sc->client_info = h->upcb (h->upcb_cls, @@ -955,13 +954,18 @@ GNUNET_FS_search_stop (struct GNUNET_FS_SearchContext *sc) { struct GNUNET_FS_ProgressInfo pi; unsigned int i; + struct GNUNET_FS_SearchContext *parent; // FIXME: make un-persistent! - if (NULL != sc->parent) + if (NULL != (parent = sc->parent)) { - // FIXME: need to untrack sc - // in parent! + GNUNET_CONTAINER_DLL_remove (parent->child_head, + parent->child_tail, + sc); + sc->parent = NULL; } + while (NULL != sc->child_head) + GNUNET_FS_search_stop (sc->child_head); GNUNET_CONTAINER_multihashmap_iterate (sc->master_result_map, &search_result_free, 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 @@ * @brief Test for fs_namespace.c * @author Christian Grothoff * - * - * FIXME: - * - child search of "sks" search (the "next" identifier) is not stopped => no termination! * TODO: * - add timeout task */ @@ -220,8 +217,6 @@ progress_cb (void *cls, case GNUNET_FS_STATUS_SEARCH_STOPPED: fprintf (stderr, "Search stop event received\n"); - GNUNET_assert ( (ksk_search == event->value.search.sc) || - (sks_search == event->value.search.sc)); return NULL; default: fprintf (stderr,