gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r1721 - in GNUnet/src: applications/advertising application


From: grothoff
Subject: [GNUnet-SVN] r1721 - in GNUnet/src: applications/advertising applications/bootstrap_http applications/session applications/topology_default server
Date: Wed, 17 Aug 2005 19:24:37 -0700 (PDT)

Author: grothoff
Date: 2005-08-17 19:24:34 -0700 (Wed, 17 Aug 2005)
New Revision: 1721

Modified:
   GNUnet/src/applications/advertising/bootstrap.c
   GNUnet/src/applications/bootstrap_http/http.c
   GNUnet/src/applications/session/connect.c
   GNUnet/src/applications/topology_default/topology.c
   GNUnet/src/server/connection.c
   GNUnet/src/server/handler.c
Log:
debugging

Modified: GNUnet/src/applications/advertising/bootstrap.c
===================================================================
--- GNUnet/src/applications/advertising/bootstrap.c     2005-08-18 02:13:24 UTC 
(rev 1720)
+++ GNUnet/src/applications/advertising/bootstrap.c     2005-08-18 02:24:34 UTC 
(rev 1721)
@@ -30,6 +30,8 @@
 #include "gnunet_protocols.h"
 #include "gnunet_bootstrap_service.h"
 
+#define DEBUG_BOOTSTRAP NO
+
 #define hello_HELPER_TABLE_START_SIZE 64
 
 static CoreAPIForApplication * coreAPI;
@@ -179,8 +181,10 @@
     }
     if (abort_bootstrap != NO)
       break;
+#if DEBUG_BOOTSTRAP
     LOG(LOG_DEBUG,
        "Starting bootstrap.\n");
+#endif
     cls.helosLen = 0;
     cls.helosCount = 0;
     bootstrap->bootstrap((hello_Callback)&downloadHostlistCallback,

Modified: GNUnet/src/applications/bootstrap_http/http.c
===================================================================
--- GNUnet/src/applications/bootstrap_http/http.c       2005-08-18 02:13:24 UTC 
(rev 1720)
+++ GNUnet/src/applications/bootstrap_http/http.c       2005-08-18 02:24:34 UTC 
(rev 1721)
@@ -31,6 +31,8 @@
 #include "gnunet_bootstrap_service.h"
 #include "gnunet_stats_service.h"
 
+#define DEBUG_HTTP NO
+
 #define TCP_HTTP_PORT 80
 #define HTTP_URL "http://";
 #define GET_COMMAND "GET http://%s:%u%s HTTP/1.0\r\n\r\n"
@@ -277,9 +279,11 @@
         "No hostlist URL specified in configuration, will not bootstrap.\n");
     return;
   }
+#if DEBUG_HTTP
   LOG(LOG_DEBUG, 
       "Trying to bootstrap with peers from '%s'\n",
       url);
+#endif
   cnt = 1;
   i = strlen(url);
   while (i > 0) {

Modified: GNUnet/src/applications/session/connect.c
===================================================================
--- GNUnet/src/applications/session/connect.c   2005-08-18 02:13:24 UTC (rev 
1720)
+++ GNUnet/src/applications/session/connect.c   2005-08-18 02:24:34 UTC (rev 
1721)
@@ -37,7 +37,7 @@
 
 #define hello_HELPER_TABLE_START_SIZE 64
 
-#define DEBUG_SESSION YES
+#define DEBUG_SESSION NO
 
 #define EXTRA_CHECKS YES
 
@@ -524,12 +524,15 @@
   }
   if (key.crc32 !=
       htonl(crc32N(&key, SESSIONKEY_LEN))) {
+#if DEBUG_SESSION
     LOG(LOG_WARNING,
        _("setkey '%s' from '%s' fails CRC check (have: %u, want %u).\n"),
        printSKEY(&key),
        &enc,
        ntohl(key.crc32),
        crc32N(&key, SESSIONKEY_LEN));
+#endif
+    BREAK();
     stats->change(stat_skeyRejected, 
                  1);
     return SYSERR;

Modified: GNUnet/src/applications/topology_default/topology.c
===================================================================
--- GNUnet/src/applications/topology_default/topology.c 2005-08-18 02:13:24 UTC 
(rev 1720)
+++ GNUnet/src/applications/topology_default/topology.c 2005-08-18 02:24:34 UTC 
(rev 1721)
@@ -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
@@ -157,7 +159,9 @@
 static void scanForHosts(unsigned int index) {
   IndexMatch indexMatch;
   cron_t now;
+#if DEBUG_TOPOLOGY
   EncName enc;
+#endif
 
   if (getNetworkLoadUp() > 100)
     return; /* bandwidth saturated, do not
@@ -189,12 +193,14 @@
     BREAK(); /* should REALLY not happen */
     return;
   }
+#if DEBUG_TOPOLOGY
   hash2enc(&indexMatch.match.hashPubKey,
           &enc);
   LOG(LOG_DEBUG,
       "Topology: trying to connect to '%s' in slot '%u'.\n",
       &enc,
       index);
+#endif
   coreAPI->unicast(&indexMatch.match,
                   NULL,
                   0,
@@ -210,6 +216,7 @@
  * @param hostId the peer that gave a sign of live
  */
 static void notifyPONG(PeerIdentity * hostId) {
+#if DEBUG_TOPOLOGY
   EncName enc;
 
   hash2enc(&hostId->hashPubKey,
@@ -217,6 +224,7 @@
   LOG(LOG_DEBUG,
       "Received pong from '%s', telling core that peer is still alive.\n",
       (char*)&enc);  
+#endif
   coreAPI->confirmSessionUp(hostId);
   FREE(hostId);
 }
@@ -228,8 +236,10 @@
                             void * unused) {
   cron_t now;
   cron_t act;
+  PeerIdentity * hi;
+#if DEBUG_TOPOLOGY
   EncName enc;
-  PeerIdentity * hi;
+#endif
 
   cronTime(&now);
   if (SYSERR == coreAPI->getLastActivityOf(peer, &act)) {
@@ -243,11 +253,13 @@
        to keep the connection open instead of hanging up */
     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,

Modified: GNUnet/src/server/connection.c
===================================================================
--- GNUnet/src/server/connection.c      2005-08-18 02:13:24 UTC (rev 1720)
+++ GNUnet/src/server/connection.c      2005-08-18 02:24:34 UTC (rev 1721)
@@ -1696,15 +1696,19 @@
 static void shutdownConnection(BufferEntry * be) {
   P2P_hangup_MESSAGE hangup;
   unsigned int i;
+#if DEBUG_CONNECTION
   EncName enc;
+#endif
 
   ENTRY();
+#if DEBUG_CONNECTION
   IFLOG(LOG_DEBUG,
        hash2enc(&be->session.sender.hashPubKey,
                 &enc));
   LOG(LOG_DEBUG,
       "Shutting down connection with '%s'\n",
       &enc);
+#endif
   if (be->status == STAT_DOWN)
     return; /* nothing to do */
   if (be->status == STAT_UP) {

Modified: GNUnet/src/server/handler.c
===================================================================
--- GNUnet/src/server/handler.c 2005-08-18 02:13:24 UTC (rev 1720)
+++ GNUnet/src/server/handler.c 2005-08-18 02:24:34 UTC (rev 1721)
@@ -386,6 +386,14 @@
     pos += plen;
 
     ptyp = htons(part->type);
+    IFLOG(LOG_DEBUG,
+         hash2enc(&sender->hashPubKey,
+                  &enc));
+    LOG(LOG_DEBUG,
+       "Received %s message of type %u from peer '%s'\n",
+       wasEncrypted ? "encrypted" : "plaintext",
+       ptyp,
+       &enc);
     if (YES == wasEncrypted) {
       MessagePartHandler callback;
 





reply via email to

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