[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r25927 - gnunet/src/testbed
From: |
gnunet |
Subject: |
[GNUnet-SVN] r25927 - gnunet/src/testbed |
Date: |
Mon, 28 Jan 2013 16:03:58 +0100 |
Author: harsha
Date: 2013-01-28 16:03:58 +0100 (Mon, 28 Jan 2013)
New Revision: 25927
Modified:
gnunet/src/testbed/gnunet-service-testbed.c
gnunet/src/testbed/gnunet-service-testbed.h
gnunet/src/testbed/gnunet-service-testbed_hc.c
gnunet/src/testbed/gnunet-service-testbed_oc.c
gnunet/src/testbed/testbed.conf.in
Log:
- rename "hello cache" to "cache"
Modified: gnunet/src/testbed/gnunet-service-testbed.c
===================================================================
--- gnunet/src/testbed/gnunet-service-testbed.c 2013-01-28 14:09:59 UTC (rev
25926)
+++ gnunet/src/testbed/gnunet-service-testbed.c 2013-01-28 15:03:58 UTC (rev
25927)
@@ -2190,7 +2190,7 @@
}
GNUNET_assert (GNUNET_OK ==
GNUNET_CONFIGURATION_get_value_number (cfg, "TESTBED",
- "HELLO_CACHE_SIZE",
+ "CACHE_SIZE",
&num));
GST_cache_init ((unsigned int) num);
GNUNET_assert (GNUNET_OK ==
Modified: gnunet/src/testbed/gnunet-service-testbed.h
===================================================================
--- gnunet/src/testbed/gnunet-service-testbed.h 2013-01-28 14:09:59 UTC (rev
25926)
+++ gnunet/src/testbed/gnunet-service-testbed.h 2013-01-28 15:03:58 UTC (rev
25927)
@@ -653,7 +653,7 @@
* @return the HELLO message; NULL if not found
*/
const struct GNUNET_MessageHeader *
-GST_hello_cache_lookup (const struct GNUNET_PeerIdentity *id);
+GST_cache_lookup (const struct GNUNET_PeerIdentity *id);
/**
* Caches the HELLO of the given peer. Updates the HELLO if it was already
@@ -663,8 +663,8 @@
* @param hello the HELLO message
*/
void
-GST_hello_cache_add (const struct GNUNET_PeerIdentity *id,
- const struct GNUNET_MessageHeader *hello);
+GST_cache_add (const struct GNUNET_PeerIdentity *id,
+ const struct GNUNET_MessageHeader *hello);
/**
Modified: gnunet/src/testbed/gnunet-service-testbed_hc.c
===================================================================
--- gnunet/src/testbed/gnunet-service-testbed_hc.c 2013-01-28 14:09:59 UTC
(rev 25926)
+++ gnunet/src/testbed/gnunet-service-testbed_hc.c 2013-01-28 15:03:58 UTC
(rev 25927)
@@ -27,19 +27,19 @@
#include "gnunet-service-testbed.h"
/**
- * Hello cache entry
+ * Cache entry
*/
-struct HelloCacheEntry
+struct CacheEntry
{
/**
- * DLL next ptr for least recently used hello cache entries
+ * DLL next ptr for least recently used cache entries
*/
- struct HelloCacheEntry *next;
+ struct CacheEntry *next;
/**
- * DLL prev ptr for least recently used hello cache entries
+ * DLL prev ptr for least recently used cache entries
*/
- struct HelloCacheEntry *prev;
+ struct CacheEntry *prev;
/**
* The key for this entry
@@ -53,42 +53,42 @@
};
/**
- * Hashmap to maintain HELLO cache
+ * Hashmap to maintain cache
*/
-static struct GNUNET_CONTAINER_MultiHashMap *hello_cache;
+static struct GNUNET_CONTAINER_MultiHashMap *cache;
/**
- * DLL head for least recently used hello cache entries; least recently used
+ * DLL head for least recently used cache entries; least recently used
* cache items are at the head
*/
-static struct HelloCacheEntry *lru_hcache_head;
+static struct CacheEntry *lru_hcache_head;
/**
- * DLL tail for least recently used hello cache entries; recently used cache
+ * DLL tail for least recently used cache entries; recently used cache
* items are at the tail
*/
-static struct HelloCacheEntry *lru_hcache_tail;
+static struct CacheEntry *lru_hcache_tail;
/**
- * The size of HELLO cache
+ * The size of cache
*/
-static unsigned int hello_cache_size;
+static unsigned int cache_size;
/**
- * Looks up in the hello cache and returns the HELLO of the given peer
+ * Looks up in the cache and returns the HELLO of the given peer
*
* @param id the peer identity of the peer whose HELLO has to be looked up
* @return the HELLO message; NULL if not found
*/
const struct GNUNET_MessageHeader *
-GST_hello_cache_lookup (const struct GNUNET_PeerIdentity *id)
+GST_cache_lookup (const struct GNUNET_PeerIdentity *id)
{
- struct HelloCacheEntry *entry;
+ struct CacheEntry *entry;
- if (NULL == hello_cache)
+ if (NULL == cache)
return NULL;
- entry = GNUNET_CONTAINER_multihashmap_get (hello_cache, &id->hashPubKey);
+ entry = GNUNET_CONTAINER_multihashmap_get (cache, &id->hashPubKey);
if (NULL == entry)
return NULL;
GNUNET_CONTAINER_DLL_remove (lru_hcache_head, lru_hcache_tail, entry);
@@ -98,16 +98,16 @@
/**
- * Removes the given hello cache centry from hello cache and frees its
resources
+ * Removes the given cache entry from cache and frees its resources
*
* @param entry the entry to remove
*/
static void
-GST_hello_cache_remove (struct HelloCacheEntry *entry)
+GST_cache_remove (struct CacheEntry *entry)
{
GNUNET_CONTAINER_DLL_remove (lru_hcache_head, lru_hcache_tail, entry);
GNUNET_assert (GNUNET_YES ==
- GNUNET_CONTAINER_multihashmap_remove (hello_cache,
&entry->key,
+ GNUNET_CONTAINER_multihashmap_remove (cache, &entry->key,
entry));
GNUNET_free (entry->hello);
GNUNET_free (entry);
@@ -122,25 +122,25 @@
* @param hello the HELLO message
*/
void
-GST_hello_cache_add (const struct GNUNET_PeerIdentity *id,
+GST_cache_add (const struct GNUNET_PeerIdentity *id,
const struct GNUNET_MessageHeader *hello)
{
- struct HelloCacheEntry *entry;
+ struct CacheEntry *entry;
- if (NULL == hello_cache)
+ if (NULL == cache)
return;
- entry = GNUNET_CONTAINER_multihashmap_get (hello_cache, &id->hashPubKey);
+ entry = GNUNET_CONTAINER_multihashmap_get (cache, &id->hashPubKey);
if (NULL == entry)
{
- entry = GNUNET_malloc (sizeof (struct HelloCacheEntry));
+ entry = GNUNET_malloc (sizeof (struct CacheEntry));
memcpy (&entry->key, &id->hashPubKey, sizeof (struct GNUNET_HashCode));
- if (GNUNET_CONTAINER_multihashmap_size (hello_cache) == hello_cache_size)
+ if (GNUNET_CONTAINER_multihashmap_size (cache) == cache_size)
{
GNUNET_assert (NULL != lru_hcache_head);
- GST_hello_cache_remove (lru_hcache_head);
+ GST_cache_remove (lru_hcache_head);
}
GNUNET_assert (GNUNET_OK ==
- GNUNET_CONTAINER_multihashmap_put (hello_cache, &entry->key,
+ GNUNET_CONTAINER_multihashmap_put (cache, &entry->key,
entry,
GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST));
}
@@ -164,10 +164,10 @@
{
if (0 == size)
return;
- hello_cache_size = size;
+ cache_size = size;
if (size > 1)
size = size / 2;
- hello_cache = GNUNET_CONTAINER_multihashmap_create (size, GNUNET_YES);
+ cache = GNUNET_CONTAINER_multihashmap_create (size, GNUNET_YES);
}
@@ -177,15 +177,15 @@
void
GST_cache_clear ()
{
- if (NULL != hello_cache)
- GNUNET_assert (GNUNET_CONTAINER_multihashmap_size (hello_cache) <=
- hello_cache_size);
+ if (NULL != cache)
+ GNUNET_assert (GNUNET_CONTAINER_multihashmap_size (cache) <=
+ cache_size);
while (NULL != lru_hcache_head)
- GST_hello_cache_remove (lru_hcache_head);
- if (NULL != hello_cache)
+ GST_cache_remove (lru_hcache_head);
+ if (NULL != cache)
{
- GNUNET_assert (0 == GNUNET_CONTAINER_multihashmap_size (hello_cache));
- GNUNET_CONTAINER_multihashmap_destroy (hello_cache);
+ GNUNET_assert (0 == GNUNET_CONTAINER_multihashmap_size (cache));
+ GNUNET_CONTAINER_multihashmap_destroy (cache);
}
}
Modified: gnunet/src/testbed/gnunet-service-testbed_oc.c
===================================================================
--- gnunet/src/testbed/gnunet-service-testbed_oc.c 2013-01-28 14:09:59 UTC
(rev 25926)
+++ gnunet/src/testbed/gnunet-service-testbed_oc.c 2013-01-28 15:03:58 UTC
(rev 25927)
@@ -792,7 +792,7 @@
LOG_DEBUG ("0x%llx: Received HELLO of %s\n", occ->op_id,
GNUNET_i2s (&occ->peer_identity));
occ->hello = GNUNET_malloc (msize);
- GST_hello_cache_add (&occ->peer_identity, hello);
+ GST_cache_add (&occ->peer_identity, hello);
memcpy (occ->hello, hello, msize);
GNUNET_TRANSPORT_get_hello_cancel (occ->ghh);
occ->ghh = NULL;
@@ -837,7 +837,7 @@
LOG_DEBUG ("0x%llx: Acquiring HELLO of peer %s\n", occ->op_id,
GNUNET_i2s (&occ->peer_identity));
/* Lookup for HELLO in hello cache */
- if (NULL != (hello = GST_hello_cache_lookup (&occ->peer_identity)))
+ if (NULL != (hello = GST_cache_lookup (&occ->peer_identity)))
{
LOG_DEBUG ("0x%llx: HELLO of peer %s found in cache\n", occ->op_id,
GNUNET_i2s (&occ->peer_identity));
Modified: gnunet/src/testbed/testbed.conf.in
===================================================================
--- gnunet/src/testbed/testbed.conf.in 2013-01-28 14:09:59 UTC (rev 25926)
+++ gnunet/src/testbed/testbed.conf.in 2013-01-28 15:03:58 UTC (rev 25927)
@@ -14,5 +14,5 @@
MAX_PARALLEL_OPERATIONS = 1000
MAX_PARALLEL_SERVICE_CONNECTIONS = 256
MAX_PARALLEL_TOPOLOGY_CONFIG_OPERATIONS = 1
-HELLO_CACHE_SIZE = 30
+CACHE_SIZE = 30
MAX_OPEN_FDS = 512
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r25927 - gnunet/src/testbed,
gnunet <=