gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r30441 - gnunet/src/testbed


From: gnunet
Subject: [GNUnet-SVN] r30441 - gnunet/src/testbed
Date: Mon, 28 Oct 2013 16:40:59 +0100

Author: harsha
Date: 2013-10-28 16:40:59 +0100 (Mon, 28 Oct 2013)
New Revision: 30441

Modified:
   gnunet/src/testbed/gnunet-service-testbed_connectionpool.c
Log:
- tolerate zero cache size


Modified: gnunet/src/testbed/gnunet-service-testbed_connectionpool.c
===================================================================
--- gnunet/src/testbed/gnunet-service-testbed_connectionpool.c  2013-10-28 
15:24:50 UTC (rev 30440)
+++ gnunet/src/testbed/gnunet-service-testbed_connectionpool.c  2013-10-28 
15:40:59 UTC (rev 30441)
@@ -286,6 +286,11 @@
                    GNUNET_CONTAINER_multihashmap32_remove (map,
                                                            entry->index,
                                                            entry));
+  if (GNUNET_SCHEDULER_NO_TASK != entry->notify_task)
+  {
+    GNUNET_SCHEDULER_cancel (entry->notify_task);
+    entry->notify_task = GNUNET_SCHEDULER_NO_TASK;
+  }
   LOG_DEBUG ("Cleaning up handles of a pooled connection\n");
   if (NULL != entry->handle_transport)
     GNUNET_assert (NULL != entry->op_transport);
@@ -889,7 +894,9 @@
   GNUNET_free (gh);
   gh = NULL;
   GNUNET_assert (!entry->in_lru);
-  if ( (!entry->in_pool) && (NULL != map) )
+  if (!entry->in_pool)
+    GNUNET_CONTAINER_DLL_remove (head_not_pooled, tail_not_pooled, entry);
+  if (NULL != map)
   {
     if (GNUNET_YES == GNUNET_CONTAINER_multihashmap32_contains (map,
                                                                 entry->index))
@@ -900,7 +907,6 @@
         goto unallocate;
       destroy_pooled_connection (head_lru);
     }
-    GNUNET_CONTAINER_DLL_remove (head_not_pooled, tail_not_pooled, entry);
     GNUNET_assert (GNUNET_OK ==
                    GNUNET_CONTAINER_multihashmap32_put (map,
                                                         entry->index,
@@ -908,6 +914,7 @@
                                                         
GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY));
     entry->in_pool = GNUNET_YES;
   }
+
  unallocate:
   GNUNET_assert (0 < entry->demand);
   entry->demand--;




reply via email to

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