gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r35060 - gnunet/src/transport
Date: Mon, 2 Feb 2015 10:24:50 +0100

Author: grothoff
Date: 2015-02-02 10:24:50 +0100 (Mon, 02 Feb 2015)
New Revision: 35060

Modified:
   gnunet/src/transport/gnunet-service-transport_validation.c
Log:
avoid duplication from storing PID in both address and in validation entry

Modified: gnunet/src/transport/gnunet-service-transport_validation.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport_validation.c  2015-02-02 
09:22:18 UTC (rev 35059)
+++ gnunet/src/transport/gnunet-service-transport_validation.c  2015-02-02 
09:24:50 UTC (rev 35060)
@@ -195,11 +195,6 @@
   struct GNUNET_CRYPTO_EddsaPublicKey public_key;
 
   /**
-   * The identity of the peer. FIXME: duplicated (also in 'address')
-   */
-  struct GNUNET_PeerIdentity pid;
-
-  /**
    * Cached PONG signature
    */
   struct GNUNET_CRYPTO_EddsaSignature pong_sig_cache;
@@ -415,7 +410,7 @@
                           enum GNUNET_TRANSPORT_ValidationState state)
 {
   ve->state = state;
-  GST_clients_broadcast_validation_notification (&ve->pid,
+  GST_clients_broadcast_validation_notification (&ve->address->peer,
                                                  ve->address,
                                                  ve->send_time,
                                                  ve->valid_until,
@@ -452,7 +447,8 @@
   }
   GNUNET_break (GNUNET_OK ==
                 GNUNET_CONTAINER_multipeermap_remove (validation_map,
-                                                      &ve->pid, ve));
+                                                      &ve->address->peer, 
+                                                     ve));
   if (GNUNET_YES == ve->known_to_ats)
   {
     GST_ats_expire_address (ve->address);
@@ -515,7 +511,7 @@
   GNUNET_STATISTICS_update (GST_stats,
                             gettext_noop ("# address records discarded"), 1,
                             GNUNET_NO);
-  cleanup_validation_entry (NULL, &ve->pid, ve);
+  cleanup_validation_entry (NULL, &ve->address->peer, ve);
 }
 
 
@@ -759,7 +755,7 @@
   GNUNET_STATISTICS_update (GST_stats,
                             gettext_noop ("# address revalidations started"), 
1,
                             GNUNET_NO);
-  bc = GST_blacklist_test_allowed (&ve->pid,
+  bc = GST_blacklist_test_allowed (&ve->address->peer,
                                   ve->address->transport_name,
                                    &transmit_ping_if_allowed, ve);
   if (NULL != bc)
@@ -798,7 +794,6 @@
   ve->in_use = GNUNET_SYSERR; /* not defined */
   ve->address = GNUNET_HELLO_address_copy (address);
   ve->public_key = *public_key;
-  ve->pid = address->peer;
   ve->pong_sig_valid_until = GNUNET_TIME_absolute_get_zero_();
   memset (&ve->pong_sig_cache, '\0', sizeof (struct 
GNUNET_CRYPTO_EddsaSignature));
   ve->latency = GNUNET_TIME_UNIT_FOREVER_REL;
@@ -1442,7 +1437,9 @@
     return GNUNET_OK;
   }
   /* now check that PONG is well-formed */
-  if (0 != memcmp (&ve->pid, sender, sizeof (struct GNUNET_PeerIdentity)))
+  if (0 != memcmp (&ve->address->peer, 
+                  sender, 
+                  sizeof (struct GNUNET_PeerIdentity)))
   {
     GNUNET_break_op (0);
     return GNUNET_SYSERR;
@@ -1795,10 +1792,10 @@
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 
              "Notifying about validation entry for peer `%s' address `%s' \n",
-             GNUNET_i2s (&ve->pid), 
+             GNUNET_i2s (&ve->address->peer), 
              GST_plugins_a2s (ve->address));
   ic->cb (ic->cb_cls,
-         &ve->pid, 
+         &ve->address->peer, 
          ve->address, 
          ve->send_time,
          ve->valid_until,




reply via email to

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