From 8fee5bde3e7fd7655c514d4035d57550fa4e28f2 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 4 May 2010 15:12:21 +0000 Subject: [PATCH] free active on download error --- TODO | 3 +++ src/fs/fs_download.c | 41 ++++++++++++++++++++++------------------- src/fs/fs_search.c | 1 - src/fs/fs_tree.c | 4 ---- 4 files changed, 25 insertions(+), 24 deletions(-) diff --git a/TODO b/TODO index d73406e75..57510234c 100644 --- a/TODO +++ b/TODO @@ -74,6 +74,7 @@ * FS: [CG] - datastore reservation (publishing) - location URIs (publish, search, download) + - unindex on index failure - utilize in-line files in meta data always (including in search results or when download is triggered manually and for probes); currently the data is only used when users do a general 'recursive' download @@ -113,6 +114,8 @@ - datastore * FS: - reconstruct IBLOCKS from DBLOCKS if possible (during download; see FIXME in fs_download) + - add support for pushing "already seen" search results to FS service for bloomfilter (can wait) + - use different 'priority' for probe downloads vs. normal downloads 0.9.0: * new webpage: diff --git a/src/fs/fs_download.c b/src/fs/fs_download.c index 29290756f..c3ab514d9 100644 --- a/src/fs/fs_download.c +++ b/src/fs/fs_download.c @@ -821,6 +821,24 @@ trigger_recursive_download (void *cls, } +/** + * Free entries in the map. + * + * @param cls unused (NULL) + * @param key unused + * @param entry entry of type "struct DownloadRequest" which is freed + * @return GNUNET_OK + */ +static int +free_entry (void *cls, + const GNUNET_HashCode *key, + void *entry) +{ + GNUNET_free (entry); + return GNUNET_OK; +} + + /** * Iterator over entries in the pending requests in the 'active' map for the * reply that we just got. @@ -1076,7 +1094,10 @@ process_result_with_request (void *cls, dc->th = NULL; } GNUNET_CLIENT_disconnect (dc->client, GNUNET_NO); - /* FIXME: clean up dc->active / pending! */ + GNUNET_CONTAINER_multihashmap_iterate (dc->active, + &free_entry, + NULL); + dc->pending = NULL; dc->client = NULL; GNUNET_free (sm); GNUNET_FS_download_sync_ (dc); @@ -1386,24 +1407,6 @@ deactivate_fs_download (void *cls) } -/** - * Free entries in the map. - * - * @param cls unused (NULL) - * @param key unused - * @param entry entry of type "struct DownloadRequest" which is freed - * @return GNUNET_OK - */ -static int -free_entry (void *cls, - const GNUNET_HashCode *key, - void *entry) -{ - GNUNET_free (entry); - return GNUNET_OK; -} - - /** * Create SUSPEND event for the given download operation * and then clean up our state (without stop signal). diff --git a/src/fs/fs_search.c b/src/fs/fs_search.c index 6c4224d1e..8c324252f 100644 --- a/src/fs/fs_search.c +++ b/src/fs/fs_search.c @@ -24,7 +24,6 @@ * @author Christian Grothoff * * TODO: - * - centralize code that sprintf's the 'pbuf[32]' strings * - add support for pushing "already seen" information * to FS service for bloomfilter (can wait) */ diff --git a/src/fs/fs_tree.c b/src/fs/fs_tree.c index c8cb8bab0..713594c45 100644 --- a/src/fs/fs_tree.c +++ b/src/fs/fs_tree.c @@ -23,10 +23,6 @@ * @see http://gnunet.org/encoding.php3 * @author Krista Bennett * @author Christian Grothoff - * - * TODO: - * - decide if this API should be made public (gnunet_fs_service.h) - * or remain "internal" (but with exported symbols?) */ #include "platform.h" #include "fs_tree.h" -- 2.25.1