aboutsummaryrefslogtreecommitdiff
path: root/src/testbed/gnunet-service-testbed_cache.c
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2013-02-12 10:05:57 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2013-02-12 10:05:57 +0000
commita0e7a98ec923164fb1e47d6a8302b0a2bdb41133 (patch)
treed8c86129097c9b54515fa55ab4c89b99170489f0 /src/testbed/gnunet-service-testbed_cache.c
parentffec951065ab72b166947788acc6cc6694c443cc (diff)
downloadgnunet-a0e7a98ec923164fb1e47d6a8302b0a2bdb41133.tar.gz
gnunet-a0e7a98ec923164fb1e47d6a8302b0a2bdb41133.zip
- fix
Diffstat (limited to 'src/testbed/gnunet-service-testbed_cache.c')
-rw-r--r--src/testbed/gnunet-service-testbed_cache.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/src/testbed/gnunet-service-testbed_cache.c b/src/testbed/gnunet-service-testbed_cache.c
index 112868e12..83023f353 100644
--- a/src/testbed/gnunet-service-testbed_cache.c
+++ b/src/testbed/gnunet-service-testbed_cache.c
@@ -352,12 +352,12 @@ close_handles (struct CacheEntry *entry)
352 GNUNET_TESTBED_operation_done (entry->transport_op_); 352 GNUNET_TESTBED_operation_done (entry->transport_op_);
353 entry->transport_op_ = NULL; 353 entry->transport_op_ = NULL;
354 } 354 }
355 if (NULL != entry->core_handle) 355 if (NULL != entry->core_op)
356 { 356 {
357 GNUNET_assert (NULL != entry->core_op);
358 GNUNET_TESTBED_operation_done (entry->core_op); 357 GNUNET_TESTBED_operation_done (entry->core_op);
359 entry->core_op = NULL; 358 entry->core_op = NULL;
360 } 359 }
360 GNUNET_assert (NULL == entry->core_handle);
361 if (NULL != entry->cfg) 361 if (NULL != entry->cfg)
362 { 362 {
363 GNUNET_CONFIGURATION_destroy (entry->cfg); 363 GNUNET_CONFIGURATION_destroy (entry->cfg);
@@ -669,16 +669,16 @@ opstart_get_handle_core (void *cls)
669 669
670 GNUNET_assert (NULL != entry); 670 GNUNET_assert (NULL != entry);
671 LOG_DEBUG ("Opening a CORE connection to peer %u\n", entry->peer_id); 671 LOG_DEBUG ("Opening a CORE connection to peer %u\n", entry->peer_id);
672 /* void?: We also get the handle when the connection to CORE is successful */ 672 entry->core_handle =
673 (void) GNUNET_CORE_connect (entry->cfg, entry, /* closure */ 673 GNUNET_CORE_connect (entry->cfg, entry, /* closure */
674 &core_startup_cb, /* core startup notify */ 674 &core_startup_cb, /* core startup notify */
675 &core_peer_connect_cb, /* peer connect notify */ 675 &core_peer_connect_cb, /* peer connect notify */
676 NULL, /* peer disconnect notify */ 676 NULL, /* peer disconnect notify */
677 NULL, /* inbound notify */ 677 NULL, /* inbound notify */
678 GNUNET_NO, /* inbound header only? */ 678 GNUNET_NO, /* inbound header only? */
679 NULL, /* outbound notify */ 679 NULL, /* outbound notify */
680 GNUNET_NO, /* outbound header only? */ 680 GNUNET_NO, /* outbound header only? */
681 no_handlers); 681 no_handlers);
682} 682}
683 683
684 684
@@ -824,8 +824,7 @@ cache_clear_iterator (void *cls, const struct GNUNET_HashCode *key, void *value)
824 GNUNET_break (0 == entry->demand); 824 GNUNET_break (0 == entry->demand);
825 LOG_DEBUG ("Clearing entry %u of %u\n", ++ncleared, cache_size); 825 LOG_DEBUG ("Clearing entry %u of %u\n", ++ncleared, cache_size);
826 GNUNET_CONTAINER_multihashmap_remove (cache, key, value); 826 GNUNET_CONTAINER_multihashmap_remove (cache, key, value);
827 if (0 == entry->demand) 827 close_handles (entry);
828 close_handles (entry);
829 GNUNET_free_non_null (entry->hello); 828 GNUNET_free_non_null (entry->hello);
830 GNUNET_break (GNUNET_SCHEDULER_NO_TASK == entry->expire_task); 829 GNUNET_break (GNUNET_SCHEDULER_NO_TASK == entry->expire_task);
831 GNUNET_break (NULL == entry->transport_handle_); 830 GNUNET_break (NULL == entry->transport_handle_);