gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r8778 - gnunet/src/hostlist


From: gnunet
Subject: [GNUnet-SVN] r8778 - gnunet/src/hostlist
Date: Sat, 25 Jul 2009 15:21:31 -0600

Author: grothoff
Date: 2009-07-25 15:21:31 -0600 (Sat, 25 Jul 2009)
New Revision: 8778

Modified:
   gnunet/src/hostlist/Makefile.am
   gnunet/src/hostlist/test_gnunet_daemon_hostlist.c
Log:
fix compile errors

Modified: gnunet/src/hostlist/Makefile.am
===================================================================
--- gnunet/src/hostlist/Makefile.am     2009-07-25 21:19:43 UTC (rev 8777)
+++ gnunet/src/hostlist/Makefile.am     2009-07-25 21:21:31 UTC (rev 8778)
@@ -37,6 +37,7 @@
 test_gnunet_daemon_hostlist_SOURCES = \
  test_gnunet_daemon_hostlist.c
 test_gnunet_daemon_hostlist_LDADD = \
+  $(top_builddir)/src/transport/libgnunettransport.la \
   $(top_builddir)/src/arm/libgnunetarm.la \
   $(top_builddir)/src/util/libgnunetutil.la  
 

Modified: gnunet/src/hostlist/test_gnunet_daemon_hostlist.c
===================================================================
--- gnunet/src/hostlist/test_gnunet_daemon_hostlist.c   2009-07-25 21:19:43 UTC 
(rev 8777)
+++ gnunet/src/hostlist/test_gnunet_daemon_hostlist.c   2009-07-25 21:21:31 UTC 
(rev 8778)
@@ -24,12 +24,23 @@
  */
 #include "platform.h"
 #include "gnunet_util_lib.h"
-#include "gnunet_arm_lib.h"
+#include "gnunet_arm_service.h"
+#include "gnunet_transport_service.h"
 
 #define VERBOSE GNUNET_YES
 
 #define START_ARM GNUNET_YES
 
+
+/**
+ * How long until we give up on transmitting the message?
+ */
+#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 15)
+
+static int ok;
+
+static struct GNUNET_SCHEDULER_Handle *sched;
+    
 struct PeerContext
 {
   struct GNUNET_CONFIGURATION_Handle *cfg;
@@ -42,9 +53,40 @@
 #endif
 };
 
+static struct PeerContext p1;
 
+static struct PeerContext p2;
 
+
+
 static void
+process_hello (void *cls,
+               struct GNUNET_TIME_Relative latency,
+               const struct GNUNET_PeerIdentity *peer,
+               const struct GNUNET_MessageHeader *message)
+{
+  struct PeerContext *p = cls;
+
+  GNUNET_assert (peer != NULL);
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "Received (my) `%s' from transport service of `%4s'\n",
+              "HELLO", GNUNET_i2s (peer));
+  GNUNET_assert (message != NULL);
+  p->hello = GNUNET_malloc (ntohs (message->size));
+  memcpy (p->hello, message, ntohs (message->size));
+  if ((p == &p1) && (p2.th != NULL))
+    GNUNET_TRANSPORT_offer_hello (p2.th, message);
+  if ((p == &p2) && (p1.th != NULL))
+    GNUNET_TRANSPORT_offer_hello (p1.th, message);
+
+  if ((p == &p1) && (p2.hello != NULL))
+    GNUNET_TRANSPORT_offer_hello (p1.th, p2.hello);
+  if ((p == &p2) && (p1.hello != NULL))
+    GNUNET_TRANSPORT_offer_hello (p2.th, p1.hello);
+}
+
+
+static void
 setup_peer (struct PeerContext *p, const char *cfgname)
 {
   p->cfg = GNUNET_CONFIGURATION_create ();
@@ -72,7 +114,7 @@
      const char *cfgfile, struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   GNUNET_assert (ok == 1);
-  OKPP;
+  ok++;
   sched = s;
   setup_peer (&p1, "test_gnunet_daemon_hostlist_peer1.conf");
   setup_peer (&p2, "test_gnunet_daemon_hostlist_peer2.conf");





reply via email to

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