[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r7803 - in GNUnet: contrib debian/config src/applications/f
From: |
gnunet |
Subject: |
[GNUnet-SVN] r7803 - in GNUnet: contrib debian/config src/applications/fs/gap src/applications/hostlist src/applications/session src/applications/testing src/include src/server src/transports src/util/containers |
Date: |
Sun, 19 Oct 2008 22:39:39 -0600 (MDT) |
Author: grothoff
Date: 2008-10-19 22:39:39 -0600 (Sun, 19 Oct 2008)
New Revision: 7803
Modified:
GNUnet/contrib/gnunetd.conf
GNUnet/debian/config/gnunetd.conf
GNUnet/src/applications/fs/gap/fs.c
GNUnet/src/applications/fs/gap/fs_dht.c
GNUnet/src/applications/fs/gap/gap.c
GNUnet/src/applications/fs/gap/querymanager.c
GNUnet/src/applications/fs/gap/querymanager.h
GNUnet/src/applications/fs/gap/shared.c
GNUnet/src/applications/fs/gap/shared.h
GNUnet/src/applications/hostlist/nat-peer.conf
GNUnet/src/applications/hostlist/tcp-peer.conf
GNUnet/src/applications/session/http-peer.conf
GNUnet/src/applications/session/nat-peer.conf
GNUnet/src/applications/session/tcp-peer.conf
GNUnet/src/applications/testing/gnunet-testing.conf
GNUnet/src/include/gnunet_util_containers.h
GNUnet/src/include/gnunet_util_pseudonym.h
GNUnet/src/server/gnunet-transport-check.c
GNUnet/src/transports/test.conf
GNUnet/src/util/containers/multihashmap.c
Log:
fixing renamed configuration option references
Modified: GNUnet/contrib/gnunetd.conf
===================================================================
--- GNUnet/contrib/gnunetd.conf 2008-10-20 04:35:19 UTC (rev 7802)
+++ GNUnet/contrib/gnunetd.conf 2008-10-20 04:39:39 UTC (rev 7803)
@@ -80,20 +80,20 @@
[TCP]
PORT = 2086
UPNP = YES
-BLACKLIST =
-WHITELIST =
+BLACKLISTV4 =
+BLACKLISTV6 =
+WHITELISTV4 =
+WHITELISTV6 =
[UDP]
PORT = 2086
UPNP = YES
MTU = 1472
-BLACKLIST =
-WHITELIST =
+BLACKLISTV4 =
+WHITELISTV4 =
+WHITELISTV6 =
BLACKLISTV6 =
-[UDP6]
-WHITELISTV6 =
-
[HTTP]
PORT = 1080
ADVERTISED-PORT = 80
Modified: GNUnet/debian/config/gnunetd.conf
===================================================================
--- GNUnet/debian/config/gnunetd.conf 2008-10-20 04:35:19 UTC (rev 7802)
+++ GNUnet/debian/config/gnunetd.conf 2008-10-20 04:39:39 UTC (rev 7803)
@@ -58,20 +58,10 @@
[TCP]
PORT = 2086
-[TCP6]
-PORT = 2088
-BLACKLIST =
-
[UDP]
PORT = 2086
MTU = 1472
-BLACKLIST =
-[UDP6]
-PORT = 2088
-MTU = 1452
-BLACKLIST =
-
[HTTP]
PORT = 1080
Modified: GNUnet/src/applications/fs/gap/fs.c
===================================================================
--- GNUnet/src/applications/fs/gap/fs.c 2008-10-20 04:35:19 UTC (rev 7802)
+++ GNUnet/src/applications/fs/gap/fs.c 2008-10-20 04:39:39 UTC (rev 7803)
@@ -401,7 +401,7 @@
struct FPPClosure
{
struct GNUNET_ClientHandle *sock;
- struct ResponseList *seen;
+ struct GNUNET_MultiHashMap *seen;
unsigned int processed;
int have_more;
};
@@ -418,7 +418,6 @@
{
struct FPPClosure *cls = closure;
GNUNET_HashCode hc;
- struct ResponseList *rl;
unsigned int type;
int ret;
@@ -437,10 +436,12 @@
cls->have_more = GNUNET_YES; /* switch to async processing */
if ((type == GNUNET_ECRS_BLOCKTYPE_DATA) || (ret != GNUNET_OK))
return GNUNET_SYSERR; /* unique response or client can take no more
*/
- rl = GNUNET_malloc (sizeof (struct ResponseList));
- rl->hash = hc;
- rl->next = cls->seen;
- cls->seen = rl;
+ if (cls->seen == NULL)
+ cls->seen = GNUNET_multi_hash_map_create(8);
+ GNUNET_multi_hash_map_put(cls->seen,
+ &hc,
+ NULL,
+ GNUNET_MultiHashMapOption_UNIQUE_FAST);
return GNUNET_OK;
}
@@ -456,7 +457,6 @@
{
static GNUNET_PeerIdentity all_zeros;
struct FPPClosure fpp;
- struct ResponseList *pos;
const CS_fs_request_search_MESSAGE *rs;
unsigned int keyCount;
unsigned int type;
@@ -515,12 +515,8 @@
have_target ? &rs->target : NULL,
fpp.seen, fpp.have_more);
CLEANUP:
- while (fpp.seen != NULL)
- {
- pos = fpp.seen;
- fpp.seen = pos->next;
- GNUNET_free (pos);
- }
+ if (fpp.seen != NULL)
+ GNUNET_multi_hash_map_destroy(fpp.seen);
return GNUNET_OK;
}
Modified: GNUnet/src/applications/fs/gap/fs_dht.c
===================================================================
--- GNUnet/src/applications/fs/gap/fs_dht.c 2008-10-20 04:35:19 UTC (rev
7802)
+++ GNUnet/src/applications/fs/gap/fs_dht.c 2008-10-20 04:39:39 UTC (rev
7803)
@@ -170,18 +170,19 @@
{
struct ActiveRequestRecords *record;
GNUNET_CronTime now;
- struct GNUNET_DHT_GetHandle * h;
if (dht == NULL)
return;
- h = dht->get_start (type, query, &response_callback, record);
- if (h == NULL)
- return; /* failed in DHT */
now = GNUNET_get_time ();
record = GNUNET_malloc (sizeof (struct ActiveRequestRecords));
record->end_time = now + GNUNET_GAP_MAX_DHT_DELAY;
- record->handle = h;
record->type = type;
+ record->handle = dht->get_start (type, query, &response_callback, record);
+ if (record->handle == NULL)
+ {
+ GNUNET_free(record);
+ return; /* failed in DHT */
+ }
GNUNET_mutex_lock (GNUNET_FS_lock);
record->next = records;
records = record;
Modified: GNUnet/src/applications/fs/gap/gap.c
===================================================================
--- GNUnet/src/applications/fs/gap/gap.c 2008-10-20 04:35:19 UTC (rev
7802)
+++ GNUnet/src/applications/fs/gap/gap.c 2008-10-20 04:39:39 UTC (rev
7803)
@@ -485,7 +485,7 @@
if (stats != NULL)
stats->change (stat_trust_earned, rl->value_offered);
if (rl->type != GNUNET_ECRS_BLOCKTYPE_DATA)
- GNUNET_FS_SHARED_mark_response_seen (rl, &hc);
+ GNUNET_FS_SHARED_mark_response_seen (&hc, rl);
GNUNET_FS_PLAN_success (rid, NULL, rl->response_target, rl);
value += rl->value;
rl_value = rl->value;
Modified: GNUnet/src/applications/fs/gap/querymanager.c
===================================================================
--- GNUnet/src/applications/fs/gap/querymanager.c 2008-10-20 04:35:19 UTC
(rev 7802)
+++ GNUnet/src/applications/fs/gap/querymanager.c 2008-10-20 04:39:39 UTC
(rev 7803)
@@ -138,12 +138,11 @@
unsigned int type,
struct GNUNET_ClientHandle *client,
const GNUNET_PeerIdentity * target,
- const struct ResponseList *seen,
+ const struct GNUNET_MultiHashMap *seen,
int have_more)
{
struct ClientDataList *cl;
struct RequestList *request;
- const struct ResponseList *pos;
GNUNET_GE_ASSERT (NULL, key_count > 0);
if (stats != NULL)
@@ -166,12 +165,8 @@
memcpy (&request->queries[0], query, sizeof (GNUNET_HashCode) * key_count);
if (seen != NULL)
{
- pos = seen;
- while (pos != NULL)
- {
- request->bloomfilter_entry_count++;
- pos = pos->next;
- }
+ request->bloomfilter_entry_count
+ = GNUNET_multi_hash_map_size(seen);
request->bloomfilter_size =
compute_bloomfilter_size (request->bloomfilter_entry_count);
request->bloomfilter_mutator =
@@ -181,12 +176,10 @@
GNUNET_GAP_BLOOMFILTER_K);
if (stats != NULL)
stats->change (stat_gap_client_bf_updates, 1);
- pos = seen;
- while (pos != NULL)
- {
- GNUNET_FS_SHARED_mark_response_seen (request, &pos->hash);
- pos = pos->next;
- }
+
+ GNUNET_multi_hash_map_iterate(seen,
+ (GNUNET_HashCodeIterator)
&GNUNET_FS_SHARED_mark_response_seen,
+ request);
}
GNUNET_mutex_lock (GNUNET_FS_lock);
cl = clients;
@@ -291,12 +284,12 @@
struct IteratorClosure
{
- struct ResponseList *pos;
+ struct GNUNET_BloomFilter * filter;
int mingle_number;
};
/**
- * Iterator over response list.
+ * Iterator over Map hash codes.
*
* @param arg pointer to a location where we
* have our current index into the linked list.
@@ -307,12 +300,11 @@
response_bf_iterator (GNUNET_HashCode * next, void *arg)
{
struct IteratorClosure *cls = arg;
- struct ResponseList *r = cls->pos;
+ GNUNET_HashCode n;
- if (NULL == r)
- return GNUNET_NO;
- GNUNET_FS_HELPER_mingle_hash (&r->hash, cls->mingle_number, next);
- cls->pos = r->next;
+ GNUNET_FS_HELPER_mingle_hash (next, cls->mingle_number, &n);
+ GNUNET_bloomfilter_add(cls->filter,
+ &n);
return GNUNET_YES;
}
@@ -396,15 +388,21 @@
{
rl->bloomfilter_mutator
= GNUNET_random_u32 (GNUNET_RANDOM_QUALITY_WEAK, -1);
- ic.pos = rl->responses;
+ GNUNET_bloomfilter_free(rl->bloomfilter);
+ rl->bloomfilter =
+ GNUNET_bloomfilter_init(NULL,
+ NULL,
+ bf_size,
+ GNUNET_GAP_BLOOMFILTER_K);
+ ic.filter = rl->bloomfilter;
ic.mingle_number = rl->bloomfilter_mutator;
- GNUNET_bloomfilter_resize (rl->bloomfilter,
- &response_bf_iterator,
- &ic, bf_size, GNUNET_GAP_BLOOMFILTER_K);
+ GNUNET_multi_hash_map_iterate(rl->responses,
+ &response_bf_iterator,
+ &ic);
if (stats != NULL)
stats->change (stat_gap_client_bf_updates, 1);
}
- GNUNET_FS_SHARED_mark_response_seen (rl, &hc);
+ GNUNET_FS_SHARED_mark_response_seen (&hc, rl);
/* we want more */
return GNUNET_NO;
@@ -555,7 +553,7 @@
cls->have_more = GNUNET_YES;
return ret; /* NO: delete, SYSERR: abort */
}
- GNUNET_FS_SHARED_mark_response_seen (cls->request, &hc);
+ GNUNET_FS_SHARED_mark_response_seen (&hc, cls->request);
cls->processed++;
if (cls->processed > GNUNET_GAP_MAX_ASYNC_PROCESSED)
{
Modified: GNUnet/src/applications/fs/gap/querymanager.h
===================================================================
--- GNUnet/src/applications/fs/gap/querymanager.h 2008-10-20 04:35:19 UTC
(rev 7802)
+++ GNUnet/src/applications/fs/gap/querymanager.h 2008-10-20 04:39:39 UTC
(rev 7803)
@@ -51,7 +51,7 @@
unsigned int type,
struct GNUNET_ClientHandle *client,
const GNUNET_PeerIdentity * target,
- const struct ResponseList *seen,
+ const struct GNUNET_MultiHashMap *seen,
int have_more);
/**
Modified: GNUnet/src/applications/fs/gap/shared.c
===================================================================
--- GNUnet/src/applications/fs/gap/shared.c 2008-10-20 04:35:19 UTC (rev
7802)
+++ GNUnet/src/applications/fs/gap/shared.c 2008-10-20 04:39:39 UTC (rev
7803)
@@ -38,14 +38,12 @@
void
GNUNET_FS_SHARED_free_request_list (struct RequestList *rl)
{
- struct ResponseList *repl;
struct QueryPlanEntry *planl;
- while (rl->responses != NULL)
+ if (rl->responses != NULL)
{
- repl = rl->responses;
- rl->responses = repl->next;
- GNUNET_free (repl);
+ GNUNET_multi_hash_map_destroy(rl->responses);
+ rl->responses = NULL;
}
while (rl->plan_entries != NULL)
{
@@ -87,7 +85,6 @@
const GNUNET_EC_DBlock * data,
GNUNET_HashCode * hc)
{
- struct ResponseList *seen;
GNUNET_HashCode m;
int ret;
@@ -115,13 +112,10 @@
(GNUNET_YES == GNUNET_bloomfilter_test (rl->bloomfilter, &m)))
return GNUNET_NO; /* not useful */
/* bloomfilter should cover these already */
- seen = rl->responses;
- while (seen != NULL)
- {
- if (0 == memcmp (hc, &seen->hash, sizeof (GNUNET_HashCode)))
- return GNUNET_NO;
- seen = seen->next;
- }
+ if ( (rl->responses != NULL) &&
+ (GNUNET_YES == GNUNET_multi_hash_map_contains(rl->responses,
+ hc)) )
+ return GNUNET_NO; /* not useful */
return GNUNET_OK;
}
@@ -131,10 +125,9 @@
* hash code as seen (update linked list and bloom filter).
*/
void
-GNUNET_FS_SHARED_mark_response_seen (struct RequestList *rl,
- const GNUNET_HashCode * hc)
+GNUNET_FS_SHARED_mark_response_seen (const GNUNET_HashCode * hc,
+ struct RequestList *rl)
{
- struct ResponseList *seen;
GNUNET_HashCode m;
if (rl->bloomfilter != NULL)
@@ -143,10 +136,12 @@
GNUNET_bloomfilter_add (rl->bloomfilter, &m);
}
/* update seen list */
- seen = GNUNET_malloc (sizeof (struct ResponseList));
- seen->hash = *hc;
- seen->next = rl->responses;
- rl->responses = seen;
+ if (rl->responses == NULL)
+ rl->responses = GNUNET_multi_hash_map_create(8);
+ GNUNET_multi_hash_map_put(rl->responses,
+ hc,
+ NULL,
+ GNUNET_MultiHashMapOption_UNIQUE_FAST);
}
Modified: GNUnet/src/applications/fs/gap/shared.h
===================================================================
--- GNUnet/src/applications/fs/gap/shared.h 2008-10-20 04:35:19 UTC (rev
7802)
+++ GNUnet/src/applications/fs/gap/shared.h 2008-10-20 04:39:39 UTC (rev
7803)
@@ -33,27 +33,6 @@
#include "gap.h"
/**
- * Linked list of responses that we have gotten for
- * this request. Used to avoid forwarding the same
- * response to the client multiple times and to
- * construct the bloom filter to block duplicates.
- */
-struct ResponseList
-{
-
- /**
- * This is a linked list.
- */
- struct ResponseList *next;
-
- /**
- * Hash of the dblocks of the responses.
- */
- GNUNET_HashCode hash;
-
-};
-
-/**
* Linked list with the active requests of a client.
*/
struct RequestList
@@ -68,7 +47,7 @@
* Linked list of responses that we have
* already received for this request.
*/
- struct ResponseList *responses;
+ struct GNUNET_MultiHashMap *responses;
/**
* Linked list of query plan entries that this
@@ -322,8 +301,8 @@
* hash code as seen (update linked list and bloom filter).
*/
void
-GNUNET_FS_SHARED_mark_response_seen (struct RequestList *rl,
- const GNUNET_HashCode * hc);
+GNUNET_FS_SHARED_mark_response_seen (const GNUNET_HashCode * hc,
+ struct RequestList *rl);
/**
* If the data portion and type of the value match our value in the
Modified: GNUnet/src/applications/hostlist/nat-peer.conf
===================================================================
--- GNUnet/src/applications/hostlist/nat-peer.conf 2008-10-20 04:35:19 UTC
(rev 7802)
+++ GNUnet/src/applications/hostlist/nat-peer.conf 2008-10-20 04:39:39 UTC
(rev 7803)
@@ -34,7 +34,7 @@
[TCP]
PORT = 0
-BLACKLIST =
+BLACKLISTV4 =
BLACKLISTV6 =
[NAT]
Modified: GNUnet/src/applications/hostlist/tcp-peer.conf
===================================================================
--- GNUnet/src/applications/hostlist/tcp-peer.conf 2008-10-20 04:35:19 UTC
(rev 7802)
+++ GNUnet/src/applications/hostlist/tcp-peer.conf 2008-10-20 04:39:39 UTC
(rev 7803)
@@ -34,7 +34,7 @@
[TCP]
PORT = 2086
-BLACKLIST =
+BLACKLISTV4 =
BLACKLISTV6 =
UPNP = NO
Modified: GNUnet/src/applications/session/http-peer.conf
===================================================================
--- GNUnet/src/applications/session/http-peer.conf 2008-10-20 04:35:19 UTC
(rev 7802)
+++ GNUnet/src/applications/session/http-peer.conf 2008-10-20 04:39:39 UTC
(rev 7803)
@@ -35,7 +35,7 @@
[HTTP]
PORT = 3080
-BLACKLIST =
+BLACKLISTV4 =
BLACKLISTV6 =
UPNP = NO
Modified: GNUnet/src/applications/session/nat-peer.conf
===================================================================
--- GNUnet/src/applications/session/nat-peer.conf 2008-10-20 04:35:19 UTC
(rev 7802)
+++ GNUnet/src/applications/session/nat-peer.conf 2008-10-20 04:39:39 UTC
(rev 7803)
@@ -33,7 +33,7 @@
[TCP]
PORT = 0
-BLACKLIST =
+BLACKLISTV4 =
BLACKLISTV6 =
[NAT]
Modified: GNUnet/src/applications/session/tcp-peer.conf
===================================================================
--- GNUnet/src/applications/session/tcp-peer.conf 2008-10-20 04:35:19 UTC
(rev 7802)
+++ GNUnet/src/applications/session/tcp-peer.conf 2008-10-20 04:39:39 UTC
(rev 7803)
@@ -34,7 +34,7 @@
[TCP]
PORT = 2086
-BLACKLIST =
+BLACKLISTV4 =
BLACKLISTV6 =
UPNP = NO
Modified: GNUnet/src/applications/testing/gnunet-testing.conf
===================================================================
--- GNUnet/src/applications/testing/gnunet-testing.conf 2008-10-20 04:35:19 UTC
(rev 7802)
+++ GNUnet/src/applications/testing/gnunet-testing.conf 2008-10-20 04:39:39 UTC
(rev 7803)
@@ -45,14 +45,6 @@
PORT = 12086
UPNP = NO
-[TCP6]
-PORT = 12088
-UPNP = NO
-
-[UDP6]
-PORT = 12088
-UPNP = NO
-
[FS]
QUOTA = 1024
ACTIVEMIGRATION = NO
Modified: GNUnet/src/include/gnunet_util_containers.h
===================================================================
--- GNUnet/src/include/gnunet_util_containers.h 2008-10-20 04:35:19 UTC (rev
7802)
+++ GNUnet/src/include/gnunet_util_containers.h 2008-10-20 04:39:39 UTC (rev
7803)
@@ -339,7 +339,8 @@
enum GNUNET_MultiHashMapOption {
GNUNET_MultiHashMapOption_REPLACE,
GNUNET_MultiHashMapOption_MULTIPLE,
- GNUNET_MultiHashMapOption_UNIQUE_ONLY
+ GNUNET_MultiHashMapOption_UNIQUE_ONLY,
+ GNUNET_MultiHashMapOption_UNIQUE_FAST
};
struct GNUNET_MultiHashMap *
@@ -347,7 +348,7 @@
void GNUNET_multi_hash_map_destroy(struct GNUNET_MultiHashMap* map);
-void * GNUNET_multi_hash_map_get(struct GNUNET_MultiHashMap* map,
+void * GNUNET_multi_hash_map_get(const struct GNUNET_MultiHashMap* map,
const GNUNET_HashCode * key);
int GNUNET_multi_hash_map_remove(struct GNUNET_MultiHashMap* map,
@@ -357,7 +358,7 @@
int GNUNET_multi_hash_map_remove_all(struct GNUNET_MultiHashMap* map,
const GNUNET_HashCode * key);
-int GNUNET_multi_hash_map_contains(struct GNUNET_MultiHashMap* map,
+int GNUNET_multi_hash_map_contains(const struct GNUNET_MultiHashMap* map,
const GNUNET_HashCode * key);
int GNUNET_multi_hash_map_put(struct GNUNET_MultiHashMap* map,
@@ -365,8 +366,13 @@
void * value,
enum GNUNET_MultiHashMapOption opt);
+unsigned int GNUNET_multi_hash_map_size(const struct GNUNET_MultiHashMap* map);
+int GNUNET_multi_hash_map_iterate(const struct GNUNET_MultiHashMap* map,
+ GNUNET_HashCodeIterator iterator,
+ void * cls);
+
#if 0 /* keep Emacsens' auto-indent happy */
{
#endif
Modified: GNUnet/src/include/gnunet_util_pseudonym.h
===================================================================
--- GNUnet/src/include/gnunet_util_pseudonym.h 2008-10-20 04:35:19 UTC (rev
7802)
+++ GNUnet/src/include/gnunet_util_pseudonym.h 2008-10-20 04:39:39 UTC (rev
7803)
@@ -28,6 +28,7 @@
#define GNUNET_PSEUDONYM_LIB_H
#include "gnunet_util_crypto.h"
+#include "gnunet_util_containers.h"
#ifdef __cplusplus
extern "C"
Modified: GNUnet/src/server/gnunet-transport-check.c
===================================================================
--- GNUnet/src/server/gnunet-transport-check.c 2008-10-20 04:35:19 UTC (rev
7802)
+++ GNUnet/src/server/gnunet-transport-check.c 2008-10-20 04:39:39 UTC (rev
7803)
@@ -453,16 +453,18 @@
if (!ping)
{
/* disable blacklists (loopback is often blacklisted)... */
- GNUNET_GC_set_configuration_value_string (cfg, ectx, "TCP", "BLACKLIST",
+ GNUNET_GC_set_configuration_value_string (cfg, ectx, "TCP",
"BLACKLISTV4",
"");
- GNUNET_GC_set_configuration_value_string (cfg, ectx, "TCP6",
- "BLACKLIST", "");
- GNUNET_GC_set_configuration_value_string (cfg, ectx, "UDP", "BLACKLIST",
+ GNUNET_GC_set_configuration_value_string (cfg, ectx, "TCP",
"BLACKLISTV6",
"");
- GNUNET_GC_set_configuration_value_string (cfg, ectx, "UDP6",
- "BLACKLIST", "");
+ GNUNET_GC_set_configuration_value_string (cfg, ectx, "UDP",
"BLACKLISTV4",
+ "");
+ GNUNET_GC_set_configuration_value_string (cfg, ectx, "UDP",
"BLACKLISTV6",
+ "");
GNUNET_GC_set_configuration_value_string (cfg, ectx, "HTTP",
- "BLACKLIST", "");
+ "BLACKLISTV4", "");
+ GNUNET_GC_set_configuration_value_string (cfg, ectx, "HTTP",
+ "BLACKLISTV6", "");
}
cron = GNUNET_cron_create (ectx);
if (GNUNET_OK != GNUNET_CORE_init (ectx, cfg, cron, NULL))
Modified: GNUnet/src/transports/test.conf
===================================================================
--- GNUnet/src/transports/test.conf 2008-10-20 04:35:19 UTC (rev 7802)
+++ GNUnet/src/transports/test.conf 2008-10-20 04:39:39 UTC (rev 7803)
@@ -25,27 +25,21 @@
[TCP]
PORT = 2086
+BLACKLISTV4 =
+BLACKLISTV6 =
-[TCP6]
-PORT = 2088
-BLACKLIST =
-UPNP = NO
-
[UDP]
PORT = 2086
MTU = 1472
-BLACKLIST =
+BLACKLISTV4 =
+BLACKLISTV6 =
UPNP = NO
-[UDP6]
-PORT = 2088
-MTU = 1452
-BLACKLIST =
-UPNP = NO
-
[HTTP]
PORT = 1080
UPNP = NO
+BLACKLISTV4 =
+BLACKLISTV6 =
[TESTING]
WEAKRANDOM = YES
Modified: GNUnet/src/util/containers/multihashmap.c
===================================================================
--- GNUnet/src/util/containers/multihashmap.c 2008-10-20 04:35:19 UTC (rev
7802)
+++ GNUnet/src/util/containers/multihashmap.c 2008-10-20 04:39:39 UTC (rev
7803)
@@ -73,16 +73,21 @@
}
static unsigned int
-idx_of(struct GNUNET_MultiHashMap * m,
+idx_of(const struct GNUNET_MultiHashMap * m,
const GNUNET_HashCode * key)
{
return (*(unsigned int *) key) % m->map_length;
}
+unsigned int
+GNUNET_multi_hash_map_size(const struct GNUNET_MultiHashMap* map)
+{
+ return map->size;
+}
void *
-GNUNET_multi_hash_map_get(struct GNUNET_MultiHashMap* map,
- const GNUNET_HashCode * key)
+GNUNET_multi_hash_map_get(const struct GNUNET_MultiHashMap* map,
+ const GNUNET_HashCode * key)
{
struct MapEntry* e;
@@ -96,6 +101,32 @@
return NULL;
}
+int
+GNUNET_multi_hash_map_iterate(const struct GNUNET_MultiHashMap* map,
+ GNUNET_HashCodeIterator it,
+ void * cls)
+{
+ int count;
+ unsigned int i;
+ struct MapEntry* e;
+
+ count = 0;
+ for (i=0;i<map->map_length;i++)
+ {
+ e = map->map[i];
+ while (e != NULL)
+ {
+ if (GNUNET_OK !=
+ it(&e->key,
+ cls))
+ return GNUNET_SYSERR;
+ count++;
+ e = e->next;
+ }
+ }
+ return count;
+}
+
int GNUNET_multi_hash_map_remove(struct GNUNET_MultiHashMap* map,
const GNUNET_HashCode * key,
void * value)
@@ -163,7 +194,7 @@
return ret;
}
-int GNUNET_multi_hash_map_contains(struct GNUNET_MultiHashMap* map,
+int GNUNET_multi_hash_map_contains(const struct GNUNET_MultiHashMap* map,
const GNUNET_HashCode * key)
{
struct MapEntry* e;
@@ -214,7 +245,8 @@
unsigned int i;
i = idx_of(map, key);
- if (opt != GNUNET_MultiHashMapOption_MULTIPLE)
+ if ( (opt != GNUNET_MultiHashMapOption_MULTIPLE) ||
+ (opt != GNUNET_MultiHashMapOption_UNIQUE_FAST) )
{
e = map->map[i];
while (e != NULL)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r7803 - in GNUnet: contrib debian/config src/applications/fs/gap src/applications/hostlist src/applications/session src/applications/testing src/include src/server src/transports src/util/containers,
gnunet <=