summaryrefslogtreecommitdiff
path: root/src/transport/test_plugin_transport.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2013-08-19 15:57:32 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2013-08-19 15:57:32 +0000
commit5737ce575e2fc06703d46816681f0542d8787cd6 (patch)
tree92e1c6bbd8a0b02b93b69c59e76111989ba7be93 /src/transport/test_plugin_transport.c
parent8427085ce0f294de6935dd94c3343e63a5fcb159 (diff)
make test resistant againt duplicate notifications
Diffstat (limited to 'src/transport/test_plugin_transport.c')
-rw-r--r--src/transport/test_plugin_transport.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/transport/test_plugin_transport.c b/src/transport/test_plugin_transport.c
index 60cc3c941..97a88beb5 100644
--- a/src/transport/test_plugin_transport.c
+++ b/src/transport/test_plugin_transport.c
@@ -342,6 +342,7 @@ env_notify_address (void *cls,
const char *plugin)
{
struct AddressWrapper *w;
+ struct AddressWrapper *wtmp;
void *s2a;
size_t s2a_len;
@@ -351,6 +352,16 @@ env_notify_address (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Adding address of length %u\n", addrlen);
+ for (wtmp = head; NULL != wtmp; wtmp = wtmp->next)
+ {
+ if ((addrlen == wtmp->addrlen) && (0 == memcmp (addr, wtmp->addr, addrlen)))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Duplicate address notification .... \n");
+ return;
+ }
+ }
+
w = GNUNET_new (struct AddressWrapper);
w->addr = GNUNET_malloc (addrlen);
w->addrlen = addrlen;