gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r16806 - gnunet/src/dht
Date: Tue, 13 Sep 2011 14:24:09 +0200

Author: grothoff
Date: 2011-09-13 14:24:09 +0200 (Tue, 13 Sep 2011)
New Revision: 16806

Modified:
   gnunet/src/dht/gnunet-service-dht.c
Log:
dce

Modified: gnunet/src/dht/gnunet-service-dht.c
===================================================================
--- gnunet/src/dht/gnunet-service-dht.c 2011-09-13 12:22:24 UTC (rev 16805)
+++ gnunet/src/dht/gnunet-service-dht.c 2011-09-13 12:24:09 UTC (rev 16806)
@@ -270,6 +270,7 @@
   GNUNET_SCHEDULER_TaskIdentifier ping_task;
 };
 
+
 /**
  * Peers are grouped into buckets.
  */
@@ -291,6 +292,7 @@
   unsigned int peers_size;
 };
 
+
 /**
  * Linked list of messages to send to clients.
  */
@@ -313,6 +315,7 @@
 
 };
 
+
 /**
  * Struct containing information about a client,
  * handle to connect to it, and any pending messages
@@ -458,6 +461,7 @@
   int closest;
 };
 
+
 /**
  * Record used for remembering what peers are waiting for what
  * responses (based on search key).
@@ -510,6 +514,7 @@
 
 };
 
+
 /**
  * Entry in the DHT routing table.
  */
@@ -530,13 +535,9 @@
    */
   GNUNET_HashCode key;
 
-  /**
-   * Bloomfilter of the peers we've replied to so far
-   */
-  //struct GNUNET_BloomFilter *bloom_results; Don't think we need this, just 
remove from DLL on response.
-
 };
 
+
 /**
  * Context used to calculate the number of find peer messages
  * per X time units since our last scheduled find peer message
@@ -552,6 +553,7 @@
   struct GNUNET_TIME_Absolute end;
 };
 
+
 /**
  * DHT Routing results structure
  */
@@ -569,6 +571,7 @@
 
 };
 
+
 /**
  * DHT structure for recent requests.
  */
@@ -585,6 +588,7 @@
   struct GNUNET_CONTAINER_MultiHashMap *hashmap;
 };
 
+
 struct RecentRequest
 {
   /**
@@ -751,7 +755,7 @@
  * The buckets (Kademlia routing table, complete with growth).
  * Array of size MAX_BUCKET_SIZE.
  */
-static struct PeerBucket k_buckets[MAX_BUCKETS];        /* From 0 to 
MAX_BUCKETS - 1 */
+static struct PeerBucket k_buckets[MAX_BUCKETS];
 
 /**
  * Hash map of all known peers, for easy removal from k_buckets on disconnect.
@@ -766,7 +770,7 @@
 /**
  * Maximum size for each bucket.
  */
-static unsigned int bucket_size = DEFAULT_BUCKET_SIZE;  /* Initially equal to 
DEFAULT_BUCKET_SIZE */
+static unsigned int bucket_size = DEFAULT_BUCKET_SIZE;
 
 /**
  * List of active clients.
@@ -888,43 +892,7 @@
   *((uint64_t *) hash) = uid;
 }
 
-#if AVG
-/**
- * Calculate the average send time between messages so that we can
- * ignore certain requests if we get too busy.
- *
- * @return the average time between asking core to send a message
- *         and when the buffer for copying it is passed
- */
-static struct GNUNET_TIME_Relative
-get_average_send_delay ()
-{
-  unsigned int i;
-  unsigned int divisor;
-  struct GNUNET_TIME_Relative average_time;
 
-  average_time = GNUNET_TIME_relative_get_zero ();
-  divisor = 0;
-  for (i = 0; i < MAX_REPLY_TIMES; i++)
-  {
-    average_time = GNUNET_TIME_relative_add (average_time, reply_times[i]);
-    if (reply_times[i].abs_value == (uint64_t) 0)
-      continue;
-    else
-      divisor++;
-  }
-  if (divisor == 0)
-  {
-    return average_time;
-  }
-
-  average_time = GNUNET_TIME_relative_divide (average_time, divisor);
-  fprintf (stderr, "Avg send delay: %u sends is %llu\n", divisor,
-           (unsigned long long) average_time.abs_value);
-  return average_time;
-}
-#endif
-
 /**
  * Given the largest send delay, artificially decrease it
  * so the next time around we may have a chance at sending




reply via email to

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