diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2013-01-31 12:08:58 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2013-01-31 12:08:58 +0000 |
commit | 9b4b22d13f5ced89931b0986dc43e1656c539a07 (patch) | |
tree | 2cfea5ac5d78ed3425589737484929b54295d48f /src | |
parent | b9e7b3bb3344e399cf9c8694492f5b8f4139278b (diff) | |
download | gnunet-9b4b22d13f5ced89931b0986dc43e1656c539a07.tar.gz gnunet-9b4b22d13f5ced89931b0986dc43e1656c539a07.zip |
- fixes
Diffstat (limited to 'src')
-rw-r--r-- | src/testbed/gnunet-service-testbed_hc.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/testbed/gnunet-service-testbed_hc.c b/src/testbed/gnunet-service-testbed_hc.c index ea3cbad37..9d50ae257 100644 --- a/src/testbed/gnunet-service-testbed_hc.c +++ b/src/testbed/gnunet-service-testbed_hc.c | |||
@@ -324,7 +324,11 @@ cache_remove (struct CacheEntry *entry) | |||
324 | in cache; we will however disconnect the core and transport handles */ | 324 | in cache; we will however disconnect the core and transport handles */ |
325 | GNUNET_assert (0 == entry->demand); | 325 | GNUNET_assert (0 == entry->demand); |
326 | if ((NULL != entry->next) || (NULL != entry->prev)) | 326 | if ((NULL != entry->next) || (NULL != entry->prev)) |
327 | { | ||
328 | GNUNET_assert (0 < lru_cache_size); | ||
327 | GNUNET_CONTAINER_DLL_remove (lru_cache_head, lru_cache_tail, entry); | 329 | GNUNET_CONTAINER_DLL_remove (lru_cache_head, lru_cache_tail, entry); |
330 | lru_cache_size--; | ||
331 | } | ||
328 | while (NULL != (ctxt = entry->nctxt_qhead)) | 332 | while (NULL != (ctxt = entry->nctxt_qhead)) |
329 | { | 333 | { |
330 | GNUNET_CONTAINER_DLL_remove (entry->nctxt_qhead, entry->nctxt_qtail, ctxt); | 334 | GNUNET_CONTAINER_DLL_remove (entry->nctxt_qhead, entry->nctxt_qtail, ctxt); |
@@ -648,7 +652,11 @@ cache_get_handle (unsigned int peer_id, | |||
648 | { | 652 | { |
649 | GNUNET_assert (NULL != entry); | 653 | GNUNET_assert (NULL != entry); |
650 | if (0 == entry->demand) | 654 | if (0 == entry->demand) |
655 | { | ||
656 | GNUNET_assert (0 < lru_cache_size); | ||
651 | GNUNET_CONTAINER_DLL_remove (lru_cache_head, lru_cache_tail, entry); | 657 | GNUNET_CONTAINER_DLL_remove (lru_cache_head, lru_cache_tail, entry); |
658 | lru_cache_size--; | ||
659 | } | ||
652 | } | 660 | } |
653 | if (NULL == entry) | 661 | if (NULL == entry) |
654 | entry = add_entry (&key, peer_id); | 662 | entry = add_entry (&key, peer_id); |
@@ -791,19 +799,21 @@ GST_cache_get_handle_done (struct GSTCacheGetHandle *cgh) | |||
791 | GNUNET_CONTAINER_DLL_remove (entry->nctxt_qhead, entry->nctxt_qtail, cgh->nctxt); | 799 | GNUNET_CONTAINER_DLL_remove (entry->nctxt_qhead, entry->nctxt_qtail, cgh->nctxt); |
792 | GNUNET_free (cgh->nctxt); | 800 | GNUNET_free (cgh->nctxt); |
793 | } | 801 | } |
794 | 802 | GNUNET_free (cgh); | |
795 | if (0 == entry->demand) | 803 | if (0 == entry->demand) |
796 | { | 804 | { |
797 | GNUNET_CONTAINER_DLL_insert_tail (lru_cache_head, lru_cache_tail, entry); | 805 | GNUNET_CONTAINER_DLL_insert_tail (lru_cache_head, lru_cache_tail, entry); |
806 | lru_cache_size++; | ||
798 | if (lru_cache_size > lru_cache_threshold_size) | 807 | if (lru_cache_size > lru_cache_threshold_size) |
799 | cache_remove (lru_cache_head); | 808 | cache_remove (lru_cache_head); |
800 | } | 809 | } |
801 | else | 810 | else |
802 | { | 811 | { |
803 | if (GNUNET_NO == entry->cgh_qhead->notify_called) | 812 | struct GSTCacheGetHandle *cgh2; |
813 | |||
814 | if (NULL != (cgh2 = search_suitable_cgh (entry, entry->cgh_qhead))) | ||
804 | entry->notify_task = GNUNET_SCHEDULER_add_now (&call_cgh_cb, entry); | 815 | entry->notify_task = GNUNET_SCHEDULER_add_now (&call_cgh_cb, entry); |
805 | } | 816 | } |
806 | GNUNET_free (cgh); | ||
807 | } | 817 | } |
808 | 818 | ||
809 | 819 | ||