gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r28707 - gnunet/src/transport


From: gnunet
Subject: [GNUnet-SVN] r28707 - gnunet/src/transport
Date: Mon, 19 Aug 2013 17:57:32 +0200

Author: wachs
Date: 2013-08-19 17:57:32 +0200 (Mon, 19 Aug 2013)
New Revision: 28707

Modified:
   gnunet/src/transport/test_plugin_transport.c
Log:
make test resistant againt duplicate notifications


Modified: gnunet/src/transport/test_plugin_transport.c
===================================================================
--- gnunet/src/transport/test_plugin_transport.c        2013-08-19 15:47:11 UTC 
(rev 28706)
+++ gnunet/src/transport/test_plugin_transport.c        2013-08-19 15:57:32 UTC 
(rev 28707)
@@ -342,6 +342,7 @@
                     const char *plugin)
 {
   struct AddressWrapper *w;
+  struct AddressWrapper *wtmp;
   void *s2a;
   size_t s2a_len;
 
@@ -351,6 +352,16 @@
       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;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]