gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r34190 - gnunet/src/dht
Date: Thu, 21 Aug 2014 15:30:38 +0200

Author: supriti
Date: 2014-08-21 15:30:37 +0200 (Thu, 21 Aug 2014)
New Revision: 34190

Modified:
   gnunet/src/dht/gnunet-service-xdht_datacache.c
   gnunet/src/dht/gnunet-service-xdht_neighbours.c
   gnunet/src/dht/gnunet_dht_profiler.c
Log:
Proper log messages


Modified: gnunet/src/dht/gnunet-service-xdht_datacache.c
===================================================================
--- gnunet/src/dht/gnunet-service-xdht_datacache.c      2014-08-21 12:55:17 UTC 
(rev 34189)
+++ gnunet/src/dht/gnunet-service-xdht_datacache.c      2014-08-21 13:30:37 UTC 
(rev 34190)
@@ -81,7 +81,9 @@
   GNUNET_STATISTICS_update (GDS_stats,
                             gettext_noop ("# ITEMS stored in datacache"), 1,
                             GNUNET_NO);
-   DEBUG("PUT doing put key = %s\n",GNUNET_h2s((key)));
+  
+  struct GNUNET_PeerIdentity peer = GDS_NEIGHBOURS_get_my_id();
+  DEBUG("DATACACHE_PUT KEY = %s, peer = 
%s\n",GNUNET_h2s(key),GNUNET_i2s(&peer));
   r = GNUNET_DATACACHE_put (datacache, key, data_size, data, type, expiration,
                             put_path_length, put_path);
   LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -335,12 +337,10 @@
       i++;
     }
   }
-
+  
   r = GNUNET_DATACACHE_get (datacache, key, type, &datacache_get_iterator,
                             &ctx);
-  LOG (GNUNET_ERROR_TYPE_DEBUG,
-       "DATACACHE GET for key %s completed (%d). %u results found.\n",
-       GNUNET_h2s (key), ctx.eval, r);
+  DEBUG ("DATACACHE_GET for key %s completed (%d). %u results 
found.\n",GNUNET_h2s (key), ctx.eval, r);
   return ctx.eval;
 }
 

Modified: gnunet/src/dht/gnunet-service-xdht_neighbours.c
===================================================================
--- gnunet/src/dht/gnunet-service-xdht_neighbours.c     2014-08-21 12:55:17 UTC 
(rev 34189)
+++ gnunet/src/dht/gnunet-service-xdht_neighbours.c     2014-08-21 13:30:37 UTC 
(rev 34190)
@@ -2155,10 +2155,10 @@
   next_hop = successor.next_hop;
   intermediate_trail_id = successor.trail_id;
 
+  DEBUG("PUT_REQUEST_RECEVIED KEY = %s \n",GNUNET_h2s(key));
   if (0 == GNUNET_CRYPTO_cmp_peer_identity (&best_known_dest, &my_identity))
   {
     /* I am the destination. */
-    DEBUG("PUT destination is me = %s,key 
=%s\n",GNUNET_i2s(&my_identity),GNUNET_h2s(key));
     GDS_DATACACHE_handle_put (expiration_time, key, 0, NULL,
                               block_type,data_size,data);
     GDS_CLIENTS_process_put (options, block_type, 0,
@@ -2297,12 +2297,12 @@
   
   best_known_dest = successor.best_known_destination;
   intermediate_trail_id = successor.trail_id;
-
+  
+  DEBUG("GET_REQUEST_RECEVIED KEY = %s \n",GNUNET_h2s(key));
   /* I am the destination. I have the data. */
   if (0 == GNUNET_CRYPTO_cmp_peer_identity (&my_identity,
                                             &best_known_dest))
   {
-    DEBUG("GET destination is me = %s,KEY = 
%s\n",GNUNET_i2s(&my_identity),GNUNET_h2s(key));
     GDS_DATACACHE_handle_get (key,block_type, NULL, 0,
                               NULL, 0, 1, &my_identity, NULL,&my_identity);
     return;
@@ -2312,8 +2312,8 @@
    across all the fingers. but in current implementation we don't have this 
case.
    compare finger and current_successor returns, */
   GDS_NEIGHBOURS_send_get (key, block_type, options, desired_replication_level,
-                          best_known_dest,intermediate_trail_id, 
&successor.next_hop,
-                          0, 1, &my_identity);
+                           best_known_dest,intermediate_trail_id, 
&successor.next_hop,
+                           0, 1, &my_identity);
 }
 
 
@@ -2366,7 +2366,6 @@
     GNUNET_break(0);
     return;
   }
-  DEBUG("GET RESULT  FOR DATA_SIZE = %lu\n",msize);
   current_path_index = 0;
   if(get_path_length > 0)
   {
@@ -2385,6 +2384,7 @@
   }
   if (0 == current_path_index)
   {
+    DEBUG ("GET_RESULT TO CLIENT KEY = %s, Peer = 
%s",GNUNET_h2s(key),GNUNET_i2s(&my_identity));
     GDS_CLIENTS_handle_reply (expiration, key, get_path_length,
                               get_path, put_path_length,
                               put_path, type, data_size, data);
@@ -3417,6 +3417,7 @@
   void *payload;
   size_t msize;
   uint32_t putlen;
+  uint32_t hop_count;
   size_t payload_size;
   uint64_t key_value;
 
@@ -3457,9 +3458,10 @@
   payload = &put_path[putlen];
   options = ntohl (put->options);
   intermediate_trail_id = put->intermediate_trail_id;
+  hop_count = ntohl(put->hop_count);
   payload_size = msize - (sizeof (struct PeerPutMessage) +
                           putlen * sizeof (struct GNUNET_PeerIdentity));
-
+  hop_count++;
   switch (GNUNET_BLOCK_get_key (GDS_block_context, ntohl (put->block_type),
                                 payload, payload_size, &test_key))
   {
@@ -3570,10 +3572,10 @@
   }
   
 
-
+  
   GDS_CLIENTS_process_put (options,
                            ntohl (put->block_type),
-                           ntohl (put->hop_count),
+                           hop_count,
                            ntohl (put->desired_replication_level),
                            putlen, pp,
                            GNUNET_TIME_absolute_ntoh (put->expiration_time),
@@ -3584,7 +3586,6 @@
   /* I am the final destination */
   if (0 == GNUNET_CRYPTO_cmp_peer_identity (&my_identity, &best_known_dest))
   {
-    DEBUG("PUT destination is me = %s,KEY = 
%s\n",GNUNET_i2s(&my_identity),GNUNET_h2s(&(put->key)));
     GDS_DATACACHE_handle_put (GNUNET_TIME_absolute_ntoh (put->expiration_time),
                               &(put->key),putlen, pp, ntohl (put->block_type),
                               payload_size, payload);
@@ -3595,7 +3596,7 @@
                              ntohl (put->block_type),ntohl (put->options),
                              ntohl (put->desired_replication_level),
                              best_known_dest, intermediate_trail_id, next_hop,
-                             ntohl (put->hop_count), putlen, pp,
+                             hop_count, putlen, pp,
                              GNUNET_TIME_absolute_ntoh (put->expiration_time),
                              payload, payload_size);
    }
@@ -3625,6 +3626,7 @@
   struct GNUNET_PeerIdentity *next_hop;
   uint32_t get_length;
   uint64_t key_value;
+  uint32_t hop_count;
   size_t msize;
 
 #if ENABLE_MALICIOUS
@@ -3647,7 +3649,9 @@
   best_known_dest = get->best_known_destination;
   intermediate_trail_id = get->intermediate_trail_id;
   get_path = (const struct GNUNET_PeerIdentity *)&get[1];
-
+  hop_count = get->hop_count;
+  hop_count++;
+  
   if ((msize <
        sizeof (struct PeerGetMessage) +
        get_length * sizeof (struct GNUNET_PeerIdentity)) ||
@@ -3657,7 +3661,7 @@
     GNUNET_break_op (0);
     return GNUNET_YES;
   }
-  DEBUG("PUT FOR DATA_SIZE = %lu\n",msize);
+  
   GNUNET_STATISTICS_update (GDS_stats,
                             gettext_noop
                             ("# Bytes received from other peers"), msize,
@@ -3682,7 +3686,7 @@
   memcpy (gp, get_path, get_length * sizeof (struct GNUNET_PeerIdentity));
   gp[get_length] = my_identity;
   get_length = get_length + 1;
-  GDS_CLIENTS_process_get (get->options, get->block_type,get->hop_count,
+  GDS_CLIENTS_process_get (get->options, get->block_type, hop_count,
                            get->desired_replication_level, 
get->get_path_length,
                            gp, &get->key);
   
@@ -3721,8 +3725,6 @@
   /* I am the final destination. */
   if (0 == GNUNET_CRYPTO_cmp_peer_identity(&my_identity, &best_known_dest))
   {
-    DEBUG("GET destination is me = %s,KEY = %s,get_length = %d\n",
-            GNUNET_i2s(&my_identity),GNUNET_h2s(&(get->key)),get_length);
     if (1 == get_length)
     {
       GDS_DATACACHE_handle_get (&(get->key),(get->block_type), NULL, 0,
@@ -3739,7 +3741,7 @@
   {
     GDS_NEIGHBOURS_send_get (&(get->key), get->block_type, get->options,
                              get->desired_replication_level, best_known_dest,
-                             intermediate_trail_id, next_hop, 0,
+                             intermediate_trail_id, next_hop, hop_count,
                              get_length, gp);
   }
   return GNUNET_YES;

Modified: gnunet/src/dht/gnunet_dht_profiler.c
===================================================================
--- gnunet/src/dht/gnunet_dht_profiler.c        2014-08-21 12:55:17 UTC (rev 
34189)
+++ gnunet/src/dht/gnunet_dht_profiler.c        2014-08-21 13:30:37 UTC (rev 
34190)
@@ -588,7 +588,7 @@
   }
   get_ac->nrefs++;
   ac->get_ac = get_ac;
-  DEBUG ("Doing a DHT GET for data of size %u\n", get_ac->put_data_size);
+  DEBUG ("PUT_REQUEST_START key %s \n", GNUNET_h2s((struct GNUNET_HashCode 
*)ac->put_data));
   ac->dht_get = GNUNET_DHT_get_start (ac->dht,
                                       GNUNET_BLOCK_TYPE_TEST,
                                       &get_ac->hash,
@@ -660,7 +660,7 @@
   GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK,
                               ac->put_data, ac->put_data_size);
   GNUNET_CRYPTO_hash (ac->put_data, ac->put_data_size, &ac->hash);
-  DEBUG ("Doing a DHT PUT with data of size %u\n", ac->put_data_size);
+  DEBUG ("PUT_REQUEST_START key %s \n", GNUNET_h2s((struct GNUNET_HashCode 
*)ac->put_data));
   ac->dht_put = GNUNET_DHT_put (ac->dht, &ac->hash,
                                 replication,
                                 GNUNET_DHT_RO_NONE,




reply via email to

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