gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r13891 - gnunet/src/dht


From: gnunet
Subject: [GNUnet-SVN] r13891 - gnunet/src/dht
Date: Wed, 8 Dec 2010 14:25:09 +0100

Author: nevans
Date: 2010-12-08 14:25:09 +0100 (Wed, 08 Dec 2010)
New Revision: 13891

Modified:
   gnunet/src/dht/gnunet-service-dht.c
Log:
Always log local request starts, even if malicious

Modified: gnunet/src/dht/gnunet-service-dht.c
===================================================================
--- gnunet/src/dht/gnunet-service-dht.c 2010-12-07 17:21:39 UTC (rev 13890)
+++ gnunet/src/dht/gnunet-service-dht.c 2010-12-08 13:25:09 UTC (rev 13891)
@@ -2333,8 +2333,8 @@
   else
     {
       msg_ctx->reply_bf = GNUNET_CONTAINER_bloomfilter_init (end,
-                                                                    bf_size,
-                                                                    
GNUNET_DHT_GET_BLOOMFILTER_K);
+                                                             bf_size,
+                                                             
GNUNET_DHT_GET_BLOOMFILTER_K);
     }
   type = (enum GNUNET_BLOCK_Type) ntohl (get_msg->type);
 #if DEBUG_DHT
@@ -4145,11 +4145,6 @@
     dhtlog_handle->insert_dhtkey (NULL, &dht_msg->key);
 #endif
 
-  if (GNUNET_YES == malicious_dropper)
-    {
-      GNUNET_SERVER_receive_done (client, GNUNET_OK);
-      return;
-    }
   memset(&msg_ctx, 0, sizeof(struct DHT_MessageContext));
   msg_ctx.client = find_active_client (client);
   memcpy(&msg_ctx.key, &dht_msg->key, sizeof(GNUNET_HashCode));
@@ -4160,6 +4155,7 @@
   msg_ctx.peer = &my_identity;
   msg_ctx.importance = DHT_DEFAULT_P2P_IMPORTANCE + 4; /* Make local routing a 
higher priority */
   msg_ctx.timeout = DHT_DEFAULT_P2P_TIMEOUT;
+
   if (ntohs(enc_msg->type) == GNUNET_MESSAGE_TYPE_DHT_GET)
     increment_stats(STAT_GET_START);
   else if (ntohs(enc_msg->type) == GNUNET_MESSAGE_TYPE_DHT_PUT)
@@ -4167,8 +4163,35 @@
   else if (ntohs(enc_msg->type) == GNUNET_MESSAGE_TYPE_DHT_FIND_PEER)
     increment_stats(STAT_FIND_PEER_START);
 
+  if (GNUNET_YES == malicious_dropper)
+    {
+      if (ntohs(enc_msg->type) == GNUNET_MESSAGE_TYPE_DHT_GET)
+        {
+#if DEBUG_DHT_ROUTING
+          if ((debug_routes) && (dhtlog_handle != NULL))
+            {
+              dhtlog_handle->insert_query (NULL, msg_ctx.unique_id, DHTLOG_GET,
+                                            msg_ctx.hop_count, GNUNET_NO, 
&my_identity,
+                                            &msg_ctx.key);
+            }
+#endif
+        }
+      else if (ntohs(enc_msg->type) == GNUNET_MESSAGE_TYPE_DHT_PUT)
+        {
+#if DEBUG_DHT_ROUTING
+          if ((debug_routes) && (dhtlog_handle != NULL))
+            {
+              dhtlog_handle->insert_query (NULL, msg_ctx.unique_id, DHTLOG_PUT,
+                                           msg_ctx.hop_count, GNUNET_NO, 
&my_identity,
+                                           &msg_ctx.key);
+            }
+#endif
+        }
+      GNUNET_SERVER_receive_done (client, GNUNET_OK);
+      return;
+    }
+
   demultiplex_message(enc_msg, &msg_ctx);
-
   GNUNET_SERVER_receive_done (client, GNUNET_OK);
 
 }




reply via email to

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