gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r4639 - GNUnet/src/applications/gap


From: gnunet
Subject: [GNUnet-SVN] r4639 - GNUnet/src/applications/gap
Date: Sun, 4 Mar 2007 19:01:00 -0700 (MST)

Author: grothoff
Date: 2007-03-04 19:01:00 -0700 (Sun, 04 Mar 2007)
New Revision: 4639

Modified:
   GNUnet/src/applications/gap/gap.c
Log:
better debug msgs

Modified: GNUnet/src/applications/gap/gap.c
===================================================================
--- GNUnet/src/applications/gap/gap.c   2007-03-05 02:00:04 UTC (rev 4638)
+++ GNUnet/src/applications/gap/gap.c   2007-03-05 02:01:00 UTC (rev 4639)
@@ -254,6 +254,7 @@
   return (qr->bitmap[bit>>3] & theBit) > 0;
 }
 
+
 /* ************* tracking replies, routing queries ********** */
 
 /**
@@ -1497,8 +1498,9 @@
           GE_DEBUG | GE_REQUEST | GE_USER,
           hash2enc(&query->queries[0],
                    &enc));
+  ((char*)&enc)[6] = '\0';
   GE_LOG(ectx,
-        GE_DEBUG | GE_REQUEST | GE_USER,
+        GE_INFO | GE_IMMEDIATE | GE_USER,
         "GAP is executing request for `%s':%s%s (%d)\n",
         &enc,
         doForward ? " forwarding" : "",
@@ -1611,22 +1613,32 @@
   PID_INDEX hostId;
 #if DEBUG_GAP
   EncName enc;
+  EncName enc2;
+#endif
 
+  if (host == NULL)
+    return 0; /* IGNORE local replies! */
+
+  if (ntohs(pmsg->size) < sizeof(P2P_gap_reply_MESSAGE)) {
+    GE_BREAK(ectx, 0);
+    return SYSERR; /* invalid! */
+  }
+  msg = (const P2P_gap_reply_MESSAGE *) pmsg;
+#if DEBUG_GAP
   IF_GELOG(ectx,
           GE_DEBUG | GE_REQUEST | GE_USER,
           if (host != NULL)
             hash2enc(&host->hashPubKey,
                      &enc));
+  hash2enc(&msg->primaryKey,
+          &enc2);
+  ((char*)&enc2)[6] = '\0';
   GE_LOG(ectx,
         GE_DEBUG | GE_REQUEST | GE_USER,
-        "GAP received content from `%s'\n",
+        "GAP received content %s from `%s'\n",
+        &enc2,
         (host != NULL) ? (const char*)&enc : "myself");
 #endif
-  if (ntohs(pmsg->size) < sizeof(P2P_gap_reply_MESSAGE)) {
-    GE_BREAK(ectx, 0);
-    return SYSERR; /* invalid! */
-  }
-  msg = (const P2P_gap_reply_MESSAGE *) pmsg;
        
   ite = &ROUTING_indTable_[computeRoutingIndex(&msg->primaryKey)];
   ite->successful_local_lookup_in_delay_loop = NO;





reply via email to

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