gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r2219 - GNUnet/src/applications/topology_f2f


From: durner
Subject: [GNUnet-SVN] r2219 - GNUnet/src/applications/topology_f2f
Date: Sun, 30 Oct 2005 05:56:01 -0800 (PST)

Author: durner
Date: 2005-10-30 05:55:54 -0800 (Sun, 30 Oct 2005)
New Revision: 2219

Modified:
   GNUnet/src/applications/topology_f2f/topology.c
Log:
debug output

Modified: GNUnet/src/applications/topology_f2f/topology.c
===================================================================
--- GNUnet/src/applications/topology_f2f/topology.c     2005-10-30 11:40:06 UTC 
(rev 2218)
+++ GNUnet/src/applications/topology_f2f/topology.c     2005-10-30 13:55:54 UTC 
(rev 2219)
@@ -38,6 +38,8 @@
 #include "gnunet_transport_service.h"
 #include "gnunet_pingpong_service.h"
 
+#define DEBUG_TOPOLOGY NO
+
 /**
  * After 2 minutes on an inactive connection, probe the other
  * node with a ping if we have achieved less than 50% of our
@@ -209,6 +211,15 @@
  * @param hostId the peer that gave a sign of live
  */
 static void notifyPONG(PeerIdentity * hostId) {
+#if DEBUG_TOPOLOGY
+  EncName enc;
+
+  hash2enc(&hostId->hashPubKey,
+     &enc);
+  LOG(LOG_DEBUG,
+      "Received pong from `%s', telling core that peer is still alive.\n",
+      (char*)&enc);
+#endif
   coreAPI->confirmSessionUp(hostId);
   FREE(hostId);
 }
@@ -220,6 +231,9 @@
                             void * unused) {
   cron_t now;
   cron_t act;
+#if DEBUG_TOPOLOGY
+  EncName enc;
+#endif
 
   if (weak_randomi(LIVE_PING_EFFECTIVENESS) != 0)
     return;
@@ -235,6 +249,13 @@
        to keep the connection open instead of hanging up */
     PeerIdentity * hi = MALLOC(sizeof(PeerIdentity));
     *hi = *peer;
+#if DEBUG_TOPOLOGY
+    hash2enc(&hi->hashPubKey,
+       &enc);
+    LOG(LOG_DEBUG,
+  "Sending ping to `%s' to prevent connection timeout.\n",
+  (char*)&enc);
+#endif
     if (OK != pingpong->ping(peer,
                             NO,
                             (CronJob)&notifyPONG,





reply via email to

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