gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r10621 - gnunet/src/transport
Date: Tue, 16 Mar 2010 15:50:32 +0100

Author: grothoff
Date: 2010-03-16 15:50:32 +0100 (Tue, 16 Mar 2010)
New Revision: 10621

Modified:
   gnunet/src/transport/gnunet-service-transport.c
Log:
stuff

Modified: gnunet/src/transport/gnunet-service-transport.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport.c     2010-03-16 14:12:30 UTC 
(rev 10620)
+++ gnunet/src/transport/gnunet-service-transport.c     2010-03-16 14:50:32 UTC 
(rev 10621)
@@ -26,7 +26,7 @@
  * BUGS:
  * - bi-directional nature of TCP is not exploited
  * - re-validation is broken (triggered only on successful validation,
- *   does not consider expiration times
+ *   does not consider expiration times)
  * 
  *
  * NOTE:
@@ -1187,7 +1187,7 @@
   else
     {
       GNUNET_STATISTICS_update (stats,
-                               gettext_noop ("# transmission attempts failed 
(no validated address)"),
+                               gettext_noop ("# transmission attempts failed 
(no address)"),
                                1,
                                GNUNET_NO);
     }
@@ -1259,7 +1259,7 @@
          return;               /* nobody ready */ 
        }
       GNUNET_STATISTICS_update (stats,
-                               gettext_noop ("# message delivery deferred (no 
validated address)"),
+                               gettext_noop ("# message delivery deferred (no 
address)"),
                                1,
                                GNUNET_NO);
       if (neighbour->retry_task != GNUNET_SCHEDULER_NO_TASK)
@@ -1930,8 +1930,7 @@
 
 /**
  * Create a fresh entry in our neighbour list for the given peer.
- * Will try to transmit our current HELLO to the new neighbour.  Also
- * notifies our clients about the new "connection".
+ * Will try to transmit our current HELLO to the new neighbour.
  *
  * @param peer the peer for which we create the entry
  * @return the new neighbour list entry
@@ -1976,6 +1975,8 @@
   n->timeout_task = GNUNET_SCHEDULER_add_delayed (sched,
                                                   
GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT,
                                                   &neighbour_timeout_task, n);
+  // FIXME: query PEERINFO for HELLO for this peer & 
+  // add addresses!?
   transmit_to_peer (NULL, NULL, 0,
                    HELLO_ADDRESS_EXPIRATION,
                     (const char *) our_hello, GNUNET_HELLO_size(our_hello),
@@ -2074,6 +2075,8 @@
                                      va,
                                      
GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE);
   neighbour = find_neighbour(&id);
+  /* FIXME: can neighbour be NULL here? (why do we still PING?)?  If so,
+     should we even do this? */
   if (neighbour == NULL)
     neighbour = setup_new_neighbour(&id);
   peer_address = add_peer_address(neighbour, tname, addr, addrlen);
@@ -2174,6 +2177,10 @@
       GNUNET_assert (fal != NULL);
       fal->expires = GNUNET_TIME_relative_to_absolute 
(HELLO_ADDRESS_EXPIRATION);
       fal->validated = GNUNET_YES;
+      GNUNET_STATISTICS_update (stats,
+                               gettext_noop ("# peer addresses considered 
valid"),
+                               1,
+                               GNUNET_NO);      
       fal->latency = GNUNET_TIME_absolute_get_duration (ve->send_time);
       periodic_validation_context = GNUNET_malloc(sizeof(struct 
PeriodicValidationContext));
       periodic_validation_context->foreign_address = fal;
@@ -2446,6 +2453,10 @@
   struct ForeignAddressList *fal;
   int try;
 
+  GNUNET_STATISTICS_update (stats,
+                           gettext_noop ("# valid peer addresses returned by 
peerinfo"),
+                           1,
+                           GNUNET_NO);      
   try = GNUNET_NO;
   fal = find_peer_address (n, tname, addr, addrlen);
   if (fal == NULL)
@@ -2459,13 +2470,27 @@
                  expiration.value);
 #endif
       fal = add_peer_address (n, tname, addr, addrlen);
+      if (fal == NULL)
+       {
+         GNUNET_STATISTICS_update (stats,
+                                   gettext_noop ("# previously validated 
addresses lacking transport"),
+                                   1,
+                                   GNUNET_NO); 
+       }
       try = GNUNET_YES;
     }
   if (fal == NULL)
     return GNUNET_OK;
   fal->expires = GNUNET_TIME_absolute_max (expiration,
                                           fal->expires);
-  fal->validated = GNUNET_YES;  
+  if (fal->validated == GNUNET_NO)
+    {
+      fal->validated = GNUNET_YES;  
+      GNUNET_STATISTICS_update (stats,
+                               gettext_noop ("# peer addresses considered 
valid"),
+                               1,
+                               GNUNET_NO);      
+    }
   if (try == GNUNET_YES)
     try_transmission_to_peer (n);
   return GNUNET_OK;
@@ -2555,6 +2580,17 @@
                                      n);
       try_transmission_to_peer (n);
     }
+  else
+    {
+      GNUNET_STATISTICS_update (stats,
+                               gettext_noop ("# no existing neighbour record 
while validating HELLO"),
+                               1,
+                               GNUNET_NO);      
+    }
+  GNUNET_STATISTICS_update (stats,
+                           gettext_noop ("# HELLO validations (update case)"),
+                           1,
+                           GNUNET_NO);      
   GNUNET_HELLO_iterate_new_addresses (chvc->hello,
                                      h,
                                      GNUNET_TIME_relative_to_absolute 
(HELLO_REVALIDATION_START_TIME),
@@ -2586,6 +2622,10 @@
       GNUNET_break (0);
       return GNUNET_SYSERR;
     }
+  GNUNET_STATISTICS_update (stats,
+                           gettext_noop ("# HELLOs received for validation"),
+                           1,
+                           GNUNET_NO);      
   /* first, check if load is too high */
   if (GNUNET_SCHEDULER_get_load (sched,
                                 GNUNET_SCHEDULER_PRIORITY_BACKGROUND) > 
MAX_HELLO_LOAD)
@@ -2714,7 +2754,12 @@
            GNUNET_STATISTICS_update (stats,
                                      gettext_noop ("# connected addresses"),
                                      -1,
-                                     GNUNET_NO);           
+                                     GNUNET_NO); 
+         if (GNUNET_YES == peer_pos->validated)
+           GNUNET_STATISTICS_update (stats,
+                                     gettext_noop ("# peer addresses 
considered valid"),
+                                     -1,
+                                     GNUNET_NO);      
           GNUNET_free(peer_pos);
         }
       GNUNET_free (rpos);





reply via email to

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