gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r16488 - gnunet/src/transport
Date: Sat, 13 Aug 2011 23:19:05 +0200

Author: grothoff
Date: 2011-08-13 23:19:05 +0200 (Sat, 13 Aug 2011)
New Revision: 16488

Modified:
   gnunet/src/transport/gnunet-service-transport-new.c
   gnunet/src/transport/gnunet-service-transport_hello.c
   gnunet/src/transport/gnunet-service-transport_hello.h
Log:
HELLOs

Modified: gnunet/src/transport/gnunet-service-transport-new.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport-new.c 2011-08-13 21:08:21 UTC 
(rev 16487)
+++ gnunet/src/transport/gnunet-service-transport-new.c 2011-08-13 21:19:05 UTC 
(rev 16488)
@@ -77,6 +77,30 @@
 
 
 /**
+ * Transmit our HELLO message to the given (connected) neighbour.
+ *
+ * @param cls the 'HELLO' message
+ * @param target a connected neighbour
+ * @param ats performance information (unused)
+ * @param ats_count number of records in ats (unused)
+ */
+static void
+transmit_our_hello (void *cls,
+                   const struct GNUNET_PeerIdentity *target,
+                   const struct GNUNET_TRANSPORT_ATS_Information *ats, 
+                   uint32_t ats_count)
+{
+  const struct GNUNET_MessageHeader *hello = cls;
+
+  GST_neighbours_send (target,
+                      (const char*) hello,
+                      ntohs (hello->size),
+                      GST_HELLO_ADDRESS_EXPIRATION,
+                      NULL, NULL);
+}
+
+
+/**
  * My HELLO has changed. Tell everyone who should know.
  *
  * @param cls unused
@@ -87,12 +111,8 @@
                      const struct GNUNET_MessageHeader *hello)
 {
   GST_clients_broadcast (hello, GNUNET_NO);
-  GNUNET_break (0); // FIXME
-#if 0
-  GNUNET_CONTAINER_multihashmap_iterate (neighbours,
-                                        &transmit_our_hello_if_pong,
-                                        NULL);
-#endif
+  GST_neighbours_iterate (&transmit_our_hello,
+                         (void*) hello);
 }
 
 

Modified: gnunet/src/transport/gnunet-service-transport_hello.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport_hello.c       2011-08-13 
21:08:21 UTC (rev 16487)
+++ gnunet/src/transport/gnunet-service-transport_hello.c       2011-08-13 
21:19:05 UTC (rev 16488)
@@ -31,12 +31,6 @@
 #include "gnunet-service-transport.h"
 #include "gnunet-service-transport_plugins.h"
 
-/**
- * After how long do we expire an address in a HELLO that we just
- * validated?  This value is also used for our own addresses when we
- * create a HELLO.
- */
-#define HELLO_ADDRESS_EXPIRATION GNUNET_TIME_relative_multiply 
(GNUNET_TIME_UNIT_HOURS, 12)
 
 /**
  * How often do we refresh our HELLO (due to expiration concerns)?
@@ -172,7 +166,7 @@
 
   hello_task = GNUNET_SCHEDULER_NO_TASK;
   gc.addr_pos = oal_head;
-  gc.expiration = GNUNET_TIME_relative_to_absolute (HELLO_ADDRESS_EXPIRATION);
+  gc.expiration = GNUNET_TIME_relative_to_absolute 
(GST_HELLO_ADDRESS_EXPIRATION);
   GNUNET_free (our_hello);
   our_hello = GNUNET_HELLO_create (&GST_my_public_key, 
                                   &address_generator, 

Modified: gnunet/src/transport/gnunet-service-transport_hello.h
===================================================================
--- gnunet/src/transport/gnunet-service-transport_hello.h       2011-08-13 
21:08:21 UTC (rev 16487)
+++ gnunet/src/transport/gnunet-service-transport_hello.h       2011-08-13 
21:19:05 UTC (rev 16488)
@@ -32,6 +32,14 @@
 
 
 /**
+ * After how long do we expire an address in a HELLO that we just
+ * validated?  This value is also used for our own addresses when we
+ * create a HELLO.
+ */
+#define GST_HELLO_ADDRESS_EXPIRATION GNUNET_TIME_relative_multiply 
(GNUNET_TIME_UNIT_HOURS, 12)
+
+
+/**
  * Signature of a function to call whenever our hello changes.
  *
  * @param cls closure




reply via email to

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