gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r34178 - gnunet/src/dht
Date: Wed, 20 Aug 2014 11:17:55 +0200

Author: supriti
Date: 2014-08-20 11:17:55 +0200 (Wed, 20 Aug 2014)
New Revision: 34178

Modified:
   gnunet/src/dht/gnunet-service-xdht_neighbours.c
Log:
xvine: fixes


Modified: gnunet/src/dht/gnunet-service-xdht_neighbours.c
===================================================================
--- gnunet/src/dht/gnunet-service-xdht_neighbours.c     2014-08-20 06:37:41 UTC 
(rev 34177)
+++ gnunet/src/dht/gnunet-service-xdht_neighbours.c     2014-08-20 09:17:55 UTC 
(rev 34178)
@@ -75,12 +75,12 @@
 /**
  * How long to wait before sending another find finger trail request
  */
-#define DHT_FIND_FINGER_TRAIL_INTERVAL GNUNET_TIME_relative_multiply 
(GNUNET_TIME_UNIT_MILLISECONDS, 50)
+#define DHT_FIND_FINGER_TRAIL_INTERVAL GNUNET_TIME_relative_multiply 
(GNUNET_TIME_UNIT_MILLISECONDS, 500)
 
 /**
  * How long to wait before sending another verify successor message.
  */
-#define DHT_SEND_VERIFY_SUCCESSOR_INTERVAL GNUNET_TIME_relative_multiply 
(GNUNET_TIME_UNIT_MILLISECONDS, 5)
+#define DHT_SEND_VERIFY_SUCCESSOR_INTERVAL GNUNET_TIME_relative_multiply 
(GNUNET_TIME_UNIT_MILLISECONDS, 60)
 
 /**
  * How long at most to wait for transmission of a request to a friend ?
@@ -3499,7 +3499,29 @@
       return GNUNET_OK;
     }
   }
-
+  
+  /* Check if you are already a part of put path. */
+  unsigned int i;
+  for (i = 0; i < putlen; i++)
+  {
+    if(0 == GNUNET_CRYPTO_cmp_peer_identity (&my_identity, &put_path[i]))
+    {
+      putlen = i;
+      break;
+    }
+  }
+    
+  /* Add yourself to the list. */
+  struct GNUNET_PeerIdentity pp[putlen + 1];
+  if (0 != (options & GNUNET_DHT_RO_RECORD_ROUTE))
+  {
+    memcpy (pp, put_path, putlen * sizeof (struct GNUNET_PeerIdentity));
+    pp[putlen] = my_identity;
+    putlen++;
+  }
+  else
+    putlen = 0;
+  
   memcpy (&key_value, &(put->key), sizeof (uint64_t));
   if (0 != (GNUNET_CRYPTO_cmp_peer_identity (&best_known_dest, &my_identity)))
   {
@@ -3513,9 +3535,20 @@
                                 gettext_noop ("# Next hop to forward the 
packet not found "
                                 "trail setup request, packet dropped."),
                                 1, GNUNET_NO);
+      
       GNUNET_break_op (0);
+      //FIXME: Adding put here,only to ensure that process does not hang. but
+      // should not be here. fix the logic. 
+      GDS_DATACACHE_handle_put (GNUNET_TIME_absolute_ntoh 
(put->expiration_time),
+                                &(put->key),putlen, pp, ntohl 
(put->block_type),
+                                 payload_size, payload);
       return GNUNET_OK;
     }
+    else
+    {
+      GNUNET_assert (0 != GNUNET_CRYPTO_cmp_peer_identity (&my_identity, 
+                                                            next_hop));
+    }
   }
   else
   {
@@ -3528,28 +3561,8 @@
     best_known_dest = successor.best_known_destination;
   }
   
-  /* Check if you are already a part of put path. */
-  unsigned int i;
-  for (i = 0; i < putlen; i++)
-  {
-    if(0 == GNUNET_CRYPTO_cmp_peer_identity (&my_identity, &put_path[i]))
-    {
-      putlen = i;
-      break;
-    }
-  }
-    
-  /* Add yourself to the list. */
-  struct GNUNET_PeerIdentity pp[putlen + 1];
-  if (0 != (options & GNUNET_DHT_RO_RECORD_ROUTE))
-  {
-    memcpy (pp, put_path, putlen * sizeof (struct GNUNET_PeerIdentity));
-    pp[putlen] = my_identity;
-    putlen++;
-  }
-  else
-    putlen = 0;
 
+
   GDS_CLIENTS_process_put (options,
                            ntohl (put->block_type),
                            ntohl (put->hop_count),




reply via email to

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