diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-03-25 08:06:58 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-03-25 08:06:58 +0000 |
commit | f094448e150652facb82024f45dea7193650c2bc (patch) | |
tree | e8ce22c6c31547b5336daa640b3684338e86268f /src/fs | |
parent | 9b9b15d3cc2a9d982d77e7b0f6459dc7eaf88c4c (diff) | |
download | gnunet-f094448e150652facb82024f45dea7193650c2bc.tar.gz gnunet-f094448e150652facb82024f45dea7193650c2bc.zip |
fixes
Diffstat (limited to 'src/fs')
-rw-r--r-- | src/fs/gnunet-service-fs.h | 2 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_cp.c | 4 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_indexing.c | 16 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_indexing.h | 9 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_lc.c | 1 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_new.c | 7 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_pe.c | 1 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_pr.c | 3 | ||||
-rw-r--r-- | src/fs/test_fs_download_data.conf | 2 |
9 files changed, 25 insertions, 20 deletions
diff --git a/src/fs/gnunet-service-fs.h b/src/fs/gnunet-service-fs.h index ee4cea8e2..c4a3d4bb9 100644 --- a/src/fs/gnunet-service-fs.h +++ b/src/fs/gnunet-service-fs.h | |||
@@ -33,6 +33,8 @@ | |||
33 | #include "gnunet_block_lib.h" | 33 | #include "gnunet_block_lib.h" |
34 | #include "fs.h" | 34 | #include "fs.h" |
35 | 35 | ||
36 | #define DEBUG_FS GNUNET_YES | ||
37 | |||
36 | 38 | ||
37 | /** | 39 | /** |
38 | * Should we introduce random latency in processing? Required for proper | 40 | * Should we introduce random latency in processing? Required for proper |
diff --git a/src/fs/gnunet-service-fs_cp.c b/src/fs/gnunet-service-fs_cp.c index 16ff566b2..c4e82350f 100644 --- a/src/fs/gnunet-service-fs_cp.c +++ b/src/fs/gnunet-service-fs_cp.c | |||
@@ -596,7 +596,7 @@ handle_p2p_reply (void *cls, | |||
596 | #if DEBUG_FS | 596 | #if DEBUG_FS |
597 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 597 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
598 | "Transmitting result for query `%s'\n", | 598 | "Transmitting result for query `%s'\n", |
599 | GNUNET_h2s (key)); | 599 | GNUNET_h2s (&prd->query)); |
600 | #endif | 600 | #endif |
601 | GNUNET_STATISTICS_update (GSF_stats, | 601 | GNUNET_STATISTICS_update (GSF_stats, |
602 | gettext_noop ("# replies received for other peers"), | 602 | gettext_noop ("# replies received for other peers"), |
@@ -1636,6 +1636,8 @@ clean_local_client (void *cls, | |||
1636 | void | 1636 | void |
1637 | GSF_handle_local_client_disconnect_ (const struct GSF_LocalClient *lc) | 1637 | GSF_handle_local_client_disconnect_ (const struct GSF_LocalClient *lc) |
1638 | { | 1638 | { |
1639 | if (NULL == cp_map) | ||
1640 | return; /* already cleaned up */ | ||
1639 | GNUNET_CONTAINER_multihashmap_iterate (cp_map, | 1641 | GNUNET_CONTAINER_multihashmap_iterate (cp_map, |
1640 | &clean_local_client, | 1642 | &clean_local_client, |
1641 | (void*) lc); | 1643 | (void*) lc); |
diff --git a/src/fs/gnunet-service-fs_indexing.c b/src/fs/gnunet-service-fs_indexing.c index 363755169..cc99d3962 100644 --- a/src/fs/gnunet-service-fs_indexing.c +++ b/src/fs/gnunet-service-fs_indexing.c | |||
@@ -31,11 +31,10 @@ | |||
31 | #include "gnunet_protocols.h" | 31 | #include "gnunet_protocols.h" |
32 | #include "gnunet_signatures.h" | 32 | #include "gnunet_signatures.h" |
33 | #include "gnunet_util_lib.h" | 33 | #include "gnunet_util_lib.h" |
34 | #include "gnunet-service-fs.h" | ||
34 | #include "gnunet-service-fs_indexing.h" | 35 | #include "gnunet-service-fs_indexing.h" |
35 | #include "fs.h" | 36 | #include "fs.h" |
36 | 37 | ||
37 | #define DEBUG_FS GNUNET_NO | ||
38 | |||
39 | /** | 38 | /** |
40 | * In-memory information about indexed files (also available | 39 | * In-memory information about indexed files (also available |
41 | * on-disk). | 40 | * on-disk). |
@@ -681,14 +680,10 @@ GNUNET_FS_handle_on_demand_block (const GNUNET_HashCode * key, | |||
681 | 680 | ||
682 | 681 | ||
683 | /** | 682 | /** |
684 | * Task run during shutdown. | 683 | * Shutdown the module. |
685 | * | ||
686 | * @param cls unused | ||
687 | * @param tc unused | ||
688 | */ | 684 | */ |
689 | static void | 685 | void |
690 | shutdown_task (void *cls, | 686 | GNUNET_FS_indexing_done () |
691 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
692 | { | 687 | { |
693 | struct IndexInfo *pos; | 688 | struct IndexInfo *pos; |
694 | 689 | ||
@@ -718,9 +713,6 @@ GNUNET_FS_indexing_init (const struct GNUNET_CONFIGURATION_Handle *c, | |||
718 | cfg = c; | 713 | cfg = c; |
719 | dsh = d; | 714 | dsh = d; |
720 | ifm = GNUNET_CONTAINER_multihashmap_create (128); | 715 | ifm = GNUNET_CONTAINER_multihashmap_create (128); |
721 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, | ||
722 | &shutdown_task, | ||
723 | NULL); | ||
724 | read_index_list (); | 716 | read_index_list (); |
725 | return GNUNET_OK; | 717 | return GNUNET_OK; |
726 | } | 718 | } |
diff --git a/src/fs/gnunet-service-fs_indexing.h b/src/fs/gnunet-service-fs_indexing.h index e606f30b1..6a2c3d4a0 100644 --- a/src/fs/gnunet-service-fs_indexing.h +++ b/src/fs/gnunet-service-fs_indexing.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | (C) 2009, 2010 Christian Grothoff (and other contributing authors) | 3 | (C) 2009, 2010, 2011 Christian Grothoff (and other contributing authors) |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
@@ -117,4 +117,11 @@ GNUNET_FS_indexing_init (const struct GNUNET_CONFIGURATION_Handle *c, | |||
117 | struct GNUNET_DATASTORE_Handle *d); | 117 | struct GNUNET_DATASTORE_Handle *d); |
118 | 118 | ||
119 | 119 | ||
120 | /** | ||
121 | * Shutdown the module. | ||
122 | */ | ||
123 | void | ||
124 | GNUNET_FS_indexing_done (void); | ||
125 | |||
126 | |||
120 | #endif | 127 | #endif |
diff --git a/src/fs/gnunet-service-fs_lc.c b/src/fs/gnunet-service-fs_lc.c index 5242316d7..2b069d9ca 100644 --- a/src/fs/gnunet-service-fs_lc.c +++ b/src/fs/gnunet-service-fs_lc.c | |||
@@ -25,6 +25,7 @@ | |||
25 | */ | 25 | */ |
26 | 26 | ||
27 | #include "platform.h" | 27 | #include "platform.h" |
28 | #include "gnunet-service-fs.h" | ||
28 | #include "gnunet-service-fs_lc.h" | 29 | #include "gnunet-service-fs_lc.h" |
29 | #include "gnunet-service-fs_cp.h" | 30 | #include "gnunet-service-fs_cp.h" |
30 | #include "gnunet-service-fs_pr.h" | 31 | #include "gnunet-service-fs_pr.h" |
diff --git a/src/fs/gnunet-service-fs_new.c b/src/fs/gnunet-service-fs_new.c index 1eea28a9d..0f5931a19 100644 --- a/src/fs/gnunet-service-fs_new.c +++ b/src/fs/gnunet-service-fs_new.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | (C) 2009, 2010 Christian Grothoff (and other contributing authors) | 3 | (C) 2009, 2010, 2011 Christian Grothoff (and other contributing authors) |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
@@ -28,7 +28,7 @@ | |||
28 | * - GSF_plan_size_ (?) | 28 | * - GSF_plan_size_ (?) |
29 | * - GSF_plan_notify_request_done (!) | 29 | * - GSF_plan_notify_request_done (!) |
30 | * - consider re-issue GSF_dht_lookup_ after non-DHT reply received | 30 | * - consider re-issue GSF_dht_lookup_ after non-DHT reply received |
31 | * | 31 | * - implement 'SUPPORT_DELAYS' |
32 | * | 32 | * |
33 | */ | 33 | */ |
34 | #include "platform.h" | 34 | #include "platform.h" |
@@ -53,8 +53,6 @@ | |||
53 | #include "gnunet-service-fs_put.h" | 53 | #include "gnunet-service-fs_put.h" |
54 | #include "fs.h" | 54 | #include "fs.h" |
55 | 55 | ||
56 | #define DEBUG_FS GNUNET_YES | ||
57 | |||
58 | /** | 56 | /** |
59 | * Size for the hash map for DHT requests from the FS | 57 | * Size for the hash map for DHT requests from the FS |
60 | * service. Should be about the number of concurrent | 58 | * service. Should be about the number of concurrent |
@@ -416,6 +414,7 @@ shutdown_task (void *cls, | |||
416 | GNUNET_SCHEDULER_cancel (cover_age_task); | 414 | GNUNET_SCHEDULER_cancel (cover_age_task); |
417 | cover_age_task = GNUNET_SCHEDULER_NO_TASK; | 415 | cover_age_task = GNUNET_SCHEDULER_NO_TASK; |
418 | } | 416 | } |
417 | GNUNET_FS_indexing_done (); | ||
419 | GNUNET_LOAD_value_free (datastore_get_load); | 418 | GNUNET_LOAD_value_free (datastore_get_load); |
420 | datastore_get_load = NULL; | 419 | datastore_get_load = NULL; |
421 | GNUNET_LOAD_value_free (GSF_rt_entry_lifetime); | 420 | GNUNET_LOAD_value_free (GSF_rt_entry_lifetime); |
diff --git a/src/fs/gnunet-service-fs_pe.c b/src/fs/gnunet-service-fs_pe.c index 00dd41f2a..fe6c995ed 100644 --- a/src/fs/gnunet-service-fs_pe.c +++ b/src/fs/gnunet-service-fs_pe.c | |||
@@ -24,6 +24,7 @@ | |||
24 | * @author Christian Grothoff | 24 | * @author Christian Grothoff |
25 | */ | 25 | */ |
26 | #include "platform.h" | 26 | #include "platform.h" |
27 | #include "gnunet-service-fs.h" | ||
27 | #include "gnunet-service-fs_cp.h" | 28 | #include "gnunet-service-fs_cp.h" |
28 | #include "gnunet-service-fs_pe.h" | 29 | #include "gnunet-service-fs_pe.h" |
29 | #include "gnunet-service-fs_pr.h" | 30 | #include "gnunet-service-fs_pr.h" |
diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c index 2c983eaed..d8cd8716e 100644 --- a/src/fs/gnunet-service-fs_pr.c +++ b/src/fs/gnunet-service-fs_pr.c | |||
@@ -25,6 +25,7 @@ | |||
25 | */ | 25 | */ |
26 | #include "platform.h" | 26 | #include "platform.h" |
27 | #include "gnunet_load_lib.h" | 27 | #include "gnunet_load_lib.h" |
28 | #include "gnunet-service-fs.h" | ||
28 | #include "gnunet-service-fs_cp.h" | 29 | #include "gnunet-service-fs_cp.h" |
29 | #include "gnunet-service-fs_indexing.h" | 30 | #include "gnunet-service-fs_indexing.h" |
30 | #include "gnunet-service-fs_pr.h" | 31 | #include "gnunet-service-fs_pr.h" |
@@ -861,7 +862,7 @@ handle_dht_reply (void *cls, | |||
861 | #if DEBUG_FS | 862 | #if DEBUG_FS |
862 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 863 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
863 | "Replicating result for query `%s' with priority %u\n", | 864 | "Replicating result for query `%s' with priority %u\n", |
864 | GNUNET_h2s (&query), | 865 | GNUNET_h2s (key), |
865 | prq.priority); | 866 | prq.priority); |
866 | #endif | 867 | #endif |
867 | start = GNUNET_malloc (sizeof (struct GNUNET_TIME_Absolute)); | 868 | start = GNUNET_malloc (sizeof (struct GNUNET_TIME_Absolute)); |
diff --git a/src/fs/test_fs_download_data.conf b/src/fs/test_fs_download_data.conf index a1b202a4d..49389526d 100644 --- a/src/fs/test_fs_download_data.conf +++ b/src/fs/test_fs_download_data.conf | |||
@@ -37,7 +37,7 @@ HOSTNAME = localhost | |||
37 | PORT = 42471 | 37 | PORT = 42471 |
38 | HOSTNAME = localhost | 38 | HOSTNAME = localhost |
39 | ACTIVEMIGRATION = NO | 39 | ACTIVEMIGRATION = NO |
40 | DEBUG = NO | 40 | DEBUG = YES |
41 | #PREFIX = valgrind --tool=memcheck --leak-check=yes | 41 | #PREFIX = valgrind --tool=memcheck --leak-check=yes |
42 | #BINARY = /home/grothoff/bin/gnunet-service-fs | 42 | #BINARY = /home/grothoff/bin/gnunet-service-fs |
43 | 43 | ||