gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r34098 - gnunet/src/dht
Date: Fri, 1 Aug 2014 14:38:42 +0200

Author: supriti
Date: 2014-08-01 14:38:42 +0200 (Fri, 01 Aug 2014)
New Revision: 34098

Modified:
   gnunet/src/dht/gnunet-service-xdht_clients.c
   gnunet/src/dht/gnunet-service-xdht_datacache.c
   gnunet/src/dht/gnunet-service-xdht_neighbours.c
   gnunet/src/dht/gnunet-service-xdht_neighbours.h
   gnunet/src/dht/gnunet_dht_profiler.c
Log:
x-vine:fixes


Modified: gnunet/src/dht/gnunet-service-xdht_clients.c
===================================================================
--- gnunet/src/dht/gnunet-service-xdht_clients.c        2014-08-01 12:20:36 UTC 
(rev 34097)
+++ gnunet/src/dht/gnunet-service-xdht_clients.c        2014-08-01 12:38:42 UTC 
(rev 34098)
@@ -501,6 +501,7 @@
     LOG (GNUNET_ERROR_TYPE_DEBUG,
          "Record type missmatch, not passing request for key %s to local 
client\n",
          GNUNET_h2s (key));
+
     GNUNET_STATISTICS_update (GDS_stats,
                               gettext_noop
                               ("# Key match, type mismatches in REPLY to 
CLIENT"),
@@ -955,10 +956,10 @@
                             size - sizeof (struct GNUNET_DHT_ClientPutMessage),
                             &put_msg[1]);
   /* FIXME: Should we store locally? */
-  GDS_DATACACHE_handle_put (GNUNET_TIME_absolute_ntoh (put_msg->expiration),
+/* GDS_DATACACHE_handle_put (GNUNET_TIME_absolute_ntoh (put_msg->expiration),
                             &put_msg->key, 0, NULL, ntohl (put_msg->type),
                             size - sizeof (struct GNUNET_DHT_ClientPutMessage),
-                            &put_msg[1]);
+                            &put_msg[1]);*/
  
   struct GNUNET_PeerIdentity my_identity =  GDS_NEIGHBOURS_get_my_id();
   struct GNUNET_PeerIdentity best_known_destination;
@@ -1338,7 +1339,7 @@
 
 #if ENABLE_MALICIOUS
 /**
- * Handler for monitor stop messages
+ * Handler for act malicous message.
  *
  * @param cls closure for the service
  * @param client the client we received this message from
@@ -1350,7 +1351,12 @@
                           const struct GNUNET_MessageHeader *message)
 {
   /* FIXME: parse message and set malicious */
-  malicious = 1;
+  const struct GNUNET_DHT_ActMaliciousMessage *msg;
+  unsigned int malicious;
+  
+  msg = (const struct GNUNET_DHT_ActMaliciousMessage *)message;
+  malicious = msg->action;
+  GDS_NEIGHBOURS_act_malicious(malicious);
 }
 #endif
 

Modified: gnunet/src/dht/gnunet-service-xdht_datacache.c
===================================================================
--- gnunet/src/dht/gnunet-service-xdht_datacache.c      2014-08-01 12:20:36 UTC 
(rev 34097)
+++ gnunet/src/dht/gnunet-service-xdht_datacache.c      2014-08-01 12:38:42 UTC 
(rev 34098)
@@ -62,7 +62,7 @@
                           const void *data)
 {
   int r;
-
+  
   if (NULL == datacache)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
@@ -74,6 +74,7 @@
     GNUNET_break (0);
     return;
   }
+  
   /* Put size is actual data size plus struct overhead plus path length (if 
any) */
   GNUNET_STATISTICS_update (GDS_stats,
                             gettext_noop ("# ITEMS stored in datacache"), 1,

Modified: gnunet/src/dht/gnunet-service-xdht_neighbours.c
===================================================================
--- gnunet/src/dht/gnunet-service-xdht_neighbours.c     2014-08-01 12:20:36 UTC 
(rev 34097)
+++ gnunet/src/dht/gnunet-service-xdht_neighbours.c     2014-08-01 12:38:42 UTC 
(rev 34098)
@@ -714,9 +714,6 @@
 };
 
 /**
- * FIXME: removed first_friend_trails_count, need to write a function
- * to calculate each time we need it. Else, keep a pointer to first
- * friend of in the trail. 
  * Information about an individual trail. 
  */
 struct Trail 
@@ -888,7 +885,6 @@
  */
 unsigned int track_topology;
 
-
 /**
  * Called when core is ready to send a message we asked for
  * out to the destination.
@@ -2139,7 +2135,7 @@
     GNUNET_break (0);
     return;
   }
- 
+  
   /* This is the first call made from clients file. So, we should search for 
the
      target_friend. */
   if (NULL == target_peer)
@@ -2157,7 +2153,9 @@
 
     if (0 == GNUNET_CRYPTO_cmp_peer_identity (&best_known_dest, &my_identity)) 
     {
-      /* I am the destination but we have already done datacache_put in client 
file.  */
+      /* I am the destination. */
+      GDS_DATACACHE_handle_put (expiration_time, key, 0, NULL, 
+                                ntohl (block_type),data_size,data);
       return;
     }
     else
@@ -2246,7 +2244,7 @@
     GNUNET_break (0);
     return;
   }
- 
+  
   /* This is the first time we got request from our own client file. */
   if (NULL == target_peer)
   {
@@ -2518,17 +2516,6 @@
       GNUNET_SCHEDULER_add_delayed (next_send_time, 
&send_find_finger_trail_message,
                                     NULL);
 
-  //FIXME: adding this check, so that once we found an entry for 0 and 64 then
-  //don't schedule. Remove it afterwards.
-  struct FingerInfo *succ;
-  struct FingerInfo *pred;
-  succ = &finger_table[0];
-  pred = &finger_table[PREDECESSOR_FINGER_ID];
-  
-  if((GNUNET_YES == succ->is_present) &&
-     (GNUNET_YES == pred->is_present))
-    return;
-  
    /* No space in my routing table. (Source and destination peers also store 
entries
    * in their routing table).  */
   if (GNUNET_YES == GDS_ROUTING_threshold_reached())
@@ -3201,12 +3188,6 @@
     /* Start looking for immediate predecessor. */
     current_search_finger_index = PREDECESSOR_FINGER_ID;
   
-    /* If I am not my own successor, then send a verify successor message. */
-    //if (0 != GNUNET_CRYPTO_cmp_peer_identity (&my_identity, 
&finger_identity))
-    //{
-      //send_verify_successor_message (successor);
-    //}
-    
     if (0 != GNUNET_CRYPTO_cmp_peer_identity (&my_identity, &finger_identity))
     {
       if (GNUNET_SCHEDULER_NO_TASK == send_verify_successor_task) 
@@ -3507,7 +3488,8 @@
   
   put = (struct PeerPutMessage *) message;
   putlen = ntohl (put->put_path_length);
-   
+  
+  
   if ((msize <
        sizeof (struct PeerPutMessage) +
        putlen * sizeof (struct GNUNET_PeerIdentity)) ||
@@ -3677,7 +3659,7 @@
   best_known_dest = get->best_known_destination;
   intermediate_trail_id = get->intermediate_trail_id;
   get_path = (const struct GNUNET_PeerIdentity *)&get[1];
-
+  
   if ((msize <
        sizeof (struct PeerGetMessage) +
        get_length * sizeof (struct GNUNET_PeerIdentity)) ||
@@ -3687,7 +3669,7 @@
     GNUNET_break_op (0);
     return GNUNET_YES; 
   }
-  
+   
   /* Add sender to get path */
   struct GNUNET_PeerIdentity gp[get_length + 1];
   if (get_length > 0)
@@ -3734,9 +3716,7 @@
     memcpy (final_get_path, gp, get_length * sizeof (struct 
GNUNET_PeerIdentity));
     memcpy (&final_get_path[get_length], &my_identity, sizeof (struct 
GNUNET_PeerIdentity));
     get_length = get_length + 1;
-    /* FIXME: here it may happen that we find our identity closest to key, but
-     we don't have the data. then in that case, we should forward the packet
-     to the next closest peer. */
+    
     GDS_DATACACHE_handle_get (&(get->key),(get->block_type), NULL, 0, NULL, 0,
                               get_length, final_get_path, 
                               &final_get_path[get_length-2], &my_identity);
@@ -3797,7 +3777,7 @@
     GNUNET_break_op (0);
     return GNUNET_YES;
   }
-  
+   
   put_path = (const struct GNUNET_PeerIdentity *) &get_result[1];
   get_path = &put_path[putlen];
   payload = (const void *) &get_path[getlen];
@@ -4492,7 +4472,9 @@
     update_predecessor (finger, trail, trail_length);
     return;
   }
-  
+  /* FIXME: Here we should first call find_successor and get a locally known
+   predecessor. If locally known predecessor is closest then current or finger,
+   add that as predecessor. */
   if (0 == GNUNET_CRYPTO_cmp_peer_identity 
(&current_predecessor->finger_identity,
                                             &finger))
   {
@@ -4729,9 +4711,9 @@
     
     /* FIXME: it may fail in case we have done more number of iterations of
      find _finger_trail_task. */
-    GNUNET_assert (0 == 
+    /*GNUNET_assert (0 == 
                    GNUNET_CRYPTO_cmp_peer_identity (closest_peer,
-                                                    
&current_successor->finger_identity));
+                                                    
&current_successor->finger_identity));*/
     
   }
   
@@ -4936,7 +4918,7 @@
     return GNUNET_SYSERR;
   }
  
-  if ((trail_length-1) == my_index) //FIXMe: SHOULD IT BE TRAIL_LENGTH - 1.s
+  if ((trail_length-1) == my_index) 
     next_hop = new_successor;
   else
     next_hop = trail[my_index + 1];
@@ -5200,7 +5182,6 @@
   
   /* Check if peer is the real peer from which we should get this message.*/
   /* Get the prev_hop for this trail by getting the next hop in opposite 
direction. */
-  /* FIXME: is using negation of trail direction correct. */
 #if 0
   GNUNET_assert (NULL != (prev_hop = 
                  GDS_ROUTING_get_next_hop (trail_id, !trail_direction)));
@@ -5303,15 +5284,13 @@
     
     if ((trail_length - 1) == my_index)
     { 
-      
       next_hop = destination_peer;
     }
     else
     {
       next_hop = trail[my_index + 1];
     }
-    /* FIXME: check that you always add trail entry even if your finger is 
-     friend. */
+    
     /* Add in your routing table. */
     GNUNET_assert (GNUNET_OK == GDS_ROUTING_add (trail_id, next_hop, *peer));
     GNUNET_assert (NULL != 
@@ -5321,8 +5300,6 @@
                                    trail, trail_length, target_friend);
     return GNUNET_OK;
   }
-  /* FIXME: check that you always add trail entry even if your finger is 
-     friend. */
   /* I am the destination. Add an entry in routing table. */
   GNUNET_assert (GNUNET_OK == GDS_ROUTING_add (trail_id, *peer, my_identity));
   return GNUNET_OK;
@@ -5445,7 +5422,6 @@
               (next_hop = 
                GDS_ROUTING_get_next_hop (trail_id, GDS_ROUTING_SRC_TO_DEST)))
       {
-        /* FIXME: This assertion fails check why*/
         GNUNET_assert (0 ==
                       (GNUNET_CRYPTO_cmp_peer_identity (next_hop,
                                                         
&remove_finger->finger_identity)));
@@ -5699,4 +5675,4 @@
   return my_identity;
 }
 
-/* end of gnunet-service-xdht_neighbours.c */
+/* end of gnunet-service-xdht_neighbours.c */
\ No newline at end of file

Modified: gnunet/src/dht/gnunet-service-xdht_neighbours.h
===================================================================
--- gnunet/src/dht/gnunet-service-xdht_neighbours.h     2014-08-01 12:20:36 UTC 
(rev 34097)
+++ gnunet/src/dht/gnunet-service-xdht_neighbours.h     2014-08-01 12:38:42 UTC 
(rev 34098)
@@ -161,5 +161,4 @@
 struct GNUNET_PeerIdentity 
 GDS_NEIGHBOURS_get_my_id (void);
 
-
 #endif

Modified: gnunet/src/dht/gnunet_dht_profiler.c
===================================================================
--- gnunet/src/dht/gnunet_dht_profiler.c        2014-08-01 12:20:36 UTC (rev 
34097)
+++ gnunet/src/dht/gnunet_dht_profiler.c        2014-08-01 12:38:42 UTC (rev 
34098)
@@ -661,8 +661,8 @@
 
   if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv))
     return 2;
-  delay = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 3); /* 
default delay */
-  timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 3); /* 
default timeout */
+  delay = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 1); /* 
default delay */
+  timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30); /* 
default timeout */
   replication = 1;      /* default replication */
   rc = 0;
   if (GNUNET_OK !=




reply via email to

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