gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r8909 - GNUnet/src/applications/dv_dht/module


From: gnunet
Subject: [GNUnet-SVN] r8909 - GNUnet/src/applications/dv_dht/module
Date: Mon, 31 Aug 2009 11:11:59 -0600

Author: nevans
Date: 2009-08-31 11:11:58 -0600 (Mon, 31 Aug 2009)
New Revision: 8909

Modified:
   GNUnet/src/applications/dv_dht/module/routing.c
Log:
minor bugfixes

Modified: GNUnet/src/applications/dv_dht/module/routing.c
===================================================================
--- GNUnet/src/applications/dv_dht/module/routing.c     2009-08-31 17:10:36 UTC 
(rev 8908)
+++ GNUnet/src/applications/dv_dht/module/routing.c     2009-08-31 17:11:58 UTC 
(rev 8909)
@@ -678,7 +678,7 @@
                hops, 2 * diameter, diameter);
       return GNUNET_SYSERR;
     }
-
+  GNUNET_mutex_lock (lock);
   routes_size = GNUNET_multi_hash_map_size (new_records.hashmap);
   heap_size = GNUNET_CONTAINER_heap_get_size (new_records.minHeap);
   if (routes_size != heap_size)
@@ -691,9 +691,10 @@
                      routes_size,
                      GNUNET_CONTAINER_heap_get_size (new_records.minHeap));
 #endif
+      GNUNET_mutex_unlock (lock);
       return GNUNET_SYSERR;
     }
-  GNUNET_mutex_lock (lock);
+
   while (routes_size >= (rt_size - 1))
     {
       q = GNUNET_CONTAINER_heap_remove_root (new_records.minHeap);
@@ -708,6 +709,9 @@
         }
       GNUNET_bloomfilter_free (q->bloom_results);
       GNUNET_multi_hash_map_remove_all (new_records.hashmap, &q->get.key);
+
+      routes_size = GNUNET_multi_hash_map_size (new_records.hashmap);
+      heap_size = GNUNET_CONTAINER_heap_get_size (new_records.minHeap);
     }
 
   routes_size = GNUNET_multi_hash_map_size (new_records.hashmap);
@@ -722,6 +726,7 @@
                      routes_size,
                      GNUNET_CONTAINER_heap_get_size (new_records.minHeap));
 #endif
+      GNUNET_mutex_unlock (lock);
       return GNUNET_SYSERR;
     }
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]