fixes
authorChristian Grothoff <christian@grothoff.org>
Fri, 25 Mar 2011 08:06:58 +0000 (08:06 +0000)
committerChristian Grothoff <christian@grothoff.org>
Fri, 25 Mar 2011 08:06:58 +0000 (08:06 +0000)
src/fs/gnunet-service-fs.h
src/fs/gnunet-service-fs_cp.c
src/fs/gnunet-service-fs_indexing.c
src/fs/gnunet-service-fs_indexing.h
src/fs/gnunet-service-fs_lc.c
src/fs/gnunet-service-fs_new.c
src/fs/gnunet-service-fs_pe.c
src/fs/gnunet-service-fs_pr.c
src/fs/test_fs_download_data.conf

index ee4cea8e23322fb964907bc1434b5fd618afb0a4..c4a3d4bb9b2db397214d33923ef438c638a6d7b7 100644 (file)
@@ -33,6 +33,8 @@
 #include "gnunet_block_lib.h"
 #include "fs.h"
 
+#define DEBUG_FS GNUNET_YES
+
 
 /**
  * Should we introduce random latency in processing?  Required for proper
index 16ff566b2f49ac06bb2d2534bba44c66ad463827..c4e82350f5c90114c9af3c5e77dbe6ba9dccefd0 100644 (file)
@@ -596,7 +596,7 @@ handle_p2p_reply (void *cls,
 #if DEBUG_FS
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
              "Transmitting result for query `%s'\n",
-             GNUNET_h2s (key));
+             GNUNET_h2s (&prd->query));
 #endif  
   GNUNET_STATISTICS_update (GSF_stats,
                            gettext_noop ("# replies received for other peers"),
@@ -1636,6 +1636,8 @@ clean_local_client (void *cls,
 void
 GSF_handle_local_client_disconnect_ (const struct GSF_LocalClient *lc)
 {
+  if (NULL == cp_map)
+    return; /* already cleaned up */
   GNUNET_CONTAINER_multihashmap_iterate (cp_map,
                                         &clean_local_client,
                                         (void*) lc);
index 363755169fa747fa24520d68395ff001715cfa8f..cc99d3962083cb12f44061e3376de2ac2f494bde 100644 (file)
 #include "gnunet_protocols.h"
 #include "gnunet_signatures.h"
 #include "gnunet_util_lib.h"
+#include "gnunet-service-fs.h"
 #include "gnunet-service-fs_indexing.h"
 #include "fs.h"
 
-#define DEBUG_FS GNUNET_NO
-
 /**
  * In-memory information about indexed files (also available
  * on-disk).
@@ -681,14 +680,10 @@ GNUNET_FS_handle_on_demand_block (const GNUNET_HashCode * key,
 
 
 /**
- * Task run during shutdown.
- *
- * @param cls unused
- * @param tc unused
+ * Shutdown the module.
  */
-static void
-shutdown_task (void *cls,
-              const struct GNUNET_SCHEDULER_TaskContext *tc)
+void
+GNUNET_FS_indexing_done ()
 {
   struct IndexInfo *pos;  
 
@@ -718,9 +713,6 @@ GNUNET_FS_indexing_init (const struct GNUNET_CONFIGURATION_Handle *c,
   cfg = c;
   dsh = d;
   ifm = GNUNET_CONTAINER_multihashmap_create (128);
-  GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
-                               &shutdown_task,
-                               NULL);
   read_index_list ();
   return GNUNET_OK;
 }
index e606f30b15ce0e21d7bcbc1f8091887a8d8b6cac..6a2c3d4a0f10c6a0d2a981d3f7427cf2d228bf76 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2009, 2010 Christian Grothoff (and other contributing authors)
+     (C) 2009, 2010, 2011 Christian Grothoff (and other contributing authors)
 
      GNUnet is free software; you can redistribute it and/or modify
      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,
                         struct GNUNET_DATASTORE_Handle *d);
 
 
+/**
+ * Shutdown the module.
+ */
+void
+GNUNET_FS_indexing_done (void);
+
+
 #endif
index 5242316d7745ade149c31ac5e95659f4702531de..2b069d9ca18f6f5abe95410efc96f8c9bacc3154 100644 (file)
@@ -25,6 +25,7 @@
  */
 
 #include "platform.h"
+#include "gnunet-service-fs.h"
 #include "gnunet-service-fs_lc.h"
 #include "gnunet-service-fs_cp.h"
 #include "gnunet-service-fs_pr.h"
index 1eea28a9d265200349ed98c104508956e4999dd3..0f5931a197c876e84426c72056ec87ff1ca78fdf 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2009, 2010 Christian Grothoff (and other contributing authors)
+     (C) 2009, 2010, 2011 Christian Grothoff (and other contributing authors)
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -28,7 +28,7 @@
  * - GSF_plan_size_ (?)
  * - GSF_plan_notify_request_done (!)
  * - consider re-issue GSF_dht_lookup_ after non-DHT reply received 
- *
+ * - implement 'SUPPORT_DELAYS'
  *
  */
 #include "platform.h"
@@ -53,8 +53,6 @@
 #include "gnunet-service-fs_put.h"
 #include "fs.h"
 
-#define DEBUG_FS GNUNET_YES
-
 /**
  * Size for the hash map for DHT requests from the FS
  * service.  Should be about the number of concurrent
@@ -416,6 +414,7 @@ shutdown_task (void *cls,
       GNUNET_SCHEDULER_cancel (cover_age_task);
       cover_age_task = GNUNET_SCHEDULER_NO_TASK;
     }
+  GNUNET_FS_indexing_done ();
   GNUNET_LOAD_value_free (datastore_get_load);
   datastore_get_load = NULL;
   GNUNET_LOAD_value_free (GSF_rt_entry_lifetime);
index 00dd41f2a74f0c9b2132088aeabf53704ad24a75..fe6c995ed14bb78102d352fd600bfde106d3eba4 100644 (file)
@@ -24,6 +24,7 @@
  * @author Christian Grothoff
  */
 #include "platform.h"
+#include "gnunet-service-fs.h"
 #include "gnunet-service-fs_cp.h"
 #include "gnunet-service-fs_pe.h"
 #include "gnunet-service-fs_pr.h"
index 2c983eaed3839b486f76d5662a5dac469b97ab4f..d8cd8716ef31e80c1f2c76652985ca0d53c4c845 100644 (file)
@@ -25,6 +25,7 @@
  */
 #include "platform.h"
 #include "gnunet_load_lib.h"
+#include "gnunet-service-fs.h"
 #include "gnunet-service-fs_cp.h"
 #include "gnunet-service-fs_indexing.h"
 #include "gnunet-service-fs_pr.h"
@@ -861,7 +862,7 @@ handle_dht_reply (void *cls,
 #if DEBUG_FS
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                  "Replicating result for query `%s' with priority %u\n",
-                 GNUNET_h2s (&query),
+                 GNUNET_h2s (key),
                  prq.priority);
 #endif
       start = GNUNET_malloc (sizeof (struct GNUNET_TIME_Absolute));
index a1b202a4d8c933fa85117d724b2152a41fc61277..49389526d368120f9874042b51fa78ab62544ecc 100644 (file)
@@ -37,7 +37,7 @@ HOSTNAME = localhost
 PORT = 42471
 HOSTNAME = localhost
 ACTIVEMIGRATION = NO
-DEBUG = NO
+DEBUG = YES
 #PREFIX = valgrind --tool=memcheck --leak-check=yes
 #BINARY = /home/grothoff/bin/gnunet-service-fs