gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r21037 - gnunet/src/dht
Date: Thu, 19 Apr 2012 17:22:23 +0200

Author: bartpolot
Date: 2012-04-19 17:22:23 +0200 (Thu, 19 Apr 2012)
New Revision: 21037

Modified:
   gnunet/src/dht/gnunet-service-dht_clients.c
   gnunet/src/dht/gnunet-service-dht_neighbours.c
   gnunet/src/dht/gnunet-service-dht_neighbours.h
Log:
- Add local DHT request to the monitoring results

Modified: gnunet/src/dht/gnunet-service-dht_clients.c
===================================================================
--- gnunet/src/dht/gnunet-service-dht_clients.c 2012-04-19 15:19:56 UTC (rev 
21036)
+++ gnunet/src/dht/gnunet-service-dht_clients.c 2012-04-19 15:22:23 UTC (rev 
21037)
@@ -490,6 +490,12 @@
                              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 @@
   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);

Modified: gnunet/src/dht/gnunet-service-dht_neighbours.c
===================================================================
--- gnunet/src/dht/gnunet-service-dht_neighbours.c      2012-04-19 15:19:56 UTC 
(rev 21036)
+++ gnunet/src/dht/gnunet-service-dht_neighbours.c      2012-04-19 15:22:23 UTC 
(rev 21037)
@@ -1826,6 +1826,7 @@
                               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 @@
   }
 }
 
+/**
+ * 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 */

Modified: gnunet/src/dht/gnunet-service-dht_neighbours.h
===================================================================
--- gnunet/src/dht/gnunet-service-dht_neighbours.h      2012-04-19 15:19:56 UTC 
(rev 21036)
+++ gnunet/src/dht/gnunet-service-dht_neighbours.h      2012-04-19 15:22:23 UTC 
(rev 21037)
@@ -135,4 +135,13 @@
 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




reply via email to

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