- Add local DHT request to the monitoring results
authorBart Polot <bart@net.in.tum.de>
Thu, 19 Apr 2012 15:22:23 +0000 (15:22 +0000)
committerBart Polot <bart@net.in.tum.de>
Thu, 19 Apr 2012 15:22:23 +0000 (15:22 +0000)
src/dht/gnunet-service-dht_clients.c
src/dht/gnunet-service-dht_neighbours.c
src/dht/gnunet-service-dht_neighbours.h

index fad2d1483d62ecf868125af353e5671b5cf683e8..2046f499019da024a7dc4716267301330ecfa514 100644 (file)
@@ -490,6 +490,12 @@ handle_dht_local_put (void *cls, struct GNUNET_SERVER_Client *client,
                              peer_bf, &dht_msg->key, 0, NULL, &dht_msg[1],
                              size -
                              sizeof (struct GNUNET_DHT_ClientPutMessage));
+  GDS_CLIENTS_process_monitor (GNUNET_MESSAGE_TYPE_DHT_MONITOR_PUT,
+    GNUNET_TIME_absolute_ntoh (dht_msg->expiration), &dht_msg->key,
+    1, GDS_NEIGHBOURS_get_id(), 0, NULL,
+    ntohl (dht_msg->desired_replication_level),
+    ntohl (dht_msg->type), &(dht_msg[1].header),
+    size - sizeof (struct GNUNET_DHT_ClientPutMessage));
   GNUNET_CONTAINER_bloomfilter_free (peer_bf);
   GNUNET_SERVER_receive_done (client, GNUNET_OK);
 }
@@ -548,6 +554,11 @@ handle_dht_local_get (void *cls, struct GNUNET_SERVER_Client *client,
   cqr->type = ntohl (get->type);
   GNUNET_CONTAINER_multihashmap_put (forward_map, &get->key, cqr,
                                      GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE);
+  GDS_CLIENTS_process_monitor (GNUNET_MESSAGE_TYPE_DHT_MONITOR_GET,
+    GNUNET_TIME_UNIT_FOREVER_ABS, &get->key,
+    0, NULL, 1, GDS_NEIGHBOURS_get_id(),
+    ntohl (get->desired_replication_level),
+    ntohl (get->type), NULL, 0);
   /* start remote requests */
   if (GNUNET_SCHEDULER_NO_TASK != retry_task)
     GNUNET_SCHEDULER_cancel (retry_task);
index 4ea5dd6f4df0a41077b8b833349f80de36f12ec1..e7c1fbee39fe10982d43f9ccebc46ee0d6e52138 100644 (file)
@@ -1826,6 +1826,7 @@ handle_dht_p2p_get (void *cls, const struct GNUNET_PeerIdentity *peer,
                               1, GNUNET_NO);
   }
 
+  /* FIXME Path */
   GDS_CLIENTS_process_monitor (GNUNET_MESSAGE_TYPE_DHT_MONITOR_GET,
     GNUNET_TIME_UNIT_FOREVER_ABS, &get->key, 0, NULL, 0, NULL,
     ntohl (get->desired_replication_level), type, NULL, 0);
@@ -2025,5 +2026,16 @@ GDS_NEIGHBOURS_done ()
   }
 }
 
+/**
+ * Get the ID of the local node.
+ * 
+ * @return identity of the local node
+ */
+struct GNUNET_PeerIdentity *
+GDS_NEIGHBOURS_get_id ()
+{
+    return &my_identity;
+}
+
 
 /* end of gnunet-service-dht_neighbours.c */
index b6e0f0ec0fbf6b342f276a555e8d2be28629c3f9..3297638463308cd1f9fa1c8213155d4423167b01 100644 (file)
@@ -135,4 +135,13 @@ void
 GDS_NEIGHBOURS_done (void);
 
 
+/**
+ * Get the ID of the local node.
+ * 
+ * @return identity of the local node
+ */
+struct GNUNET_PeerIdentity *
+GDS_NEIGHBOURS_get_id ();
+
+
 #endif