projects
/
oweals
/
gnunet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8427085
)
make test resistant againt duplicate notifications
author
Matthias Wachs
<wachs@net.in.tum.de>
Mon, 19 Aug 2013 15:57:32 +0000
(15:57 +0000)
committer
Matthias Wachs
<wachs@net.in.tum.de>
Mon, 19 Aug 2013 15:57:32 +0000
(15:57 +0000)
src/transport/test_plugin_transport.c
patch
|
blob
|
history
diff --git
a/src/transport/test_plugin_transport.c
b/src/transport/test_plugin_transport.c
index 60cc3c94133dc12be7ffe059e6395069c3bd0d9b..97a88beb5def7945ab15c30c024baed0262fcbd1 100644
(file)
--- 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;
const char *plugin)
{
struct AddressWrapper *w;
+ struct AddressWrapper *wtmp;
void *s2a;
size_t s2a_len;
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);
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;
w = GNUNET_new (struct AddressWrapper);
w->addr = GNUNET_malloc (addrlen);
w->addrlen = addrlen;