gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r13743 - gnunet/src/dht
Date: Fri, 19 Nov 2010 11:05:58 +0100

Author: nevans
Date: 2010-11-19 11:05:58 +0100 (Fri, 19 Nov 2010)
New Revision: 13743

Modified:
   gnunet/src/dht/gnunet-dht-driver.c
Log:
dont try to send to more peers that exist

Modified: gnunet/src/dht/gnunet-dht-driver.c
===================================================================
--- gnunet/src/dht/gnunet-dht-driver.c  2010-11-18 22:43:01 UTC (rev 13742)
+++ gnunet/src/dht/gnunet-dht-driver.c  2010-11-19 10:05:58 UTC (rev 13743)
@@ -2014,6 +2014,9 @@
   if (find_peer_ctx->total > max_outstanding_find_peers)
     find_peer_ctx->total = max_outstanding_find_peers;
 
+  if (find_peer_ctx->total > 
GNUNET_CONTAINER_heap_get_size(find_peer_ctx->peer_min_heap)) /* Don't try to 
send more messages than we have peers! */
+    find_peer_ctx->total = 
GNUNET_CONTAINER_heap_get_size(find_peer_ctx->peer_min_heap);
+
   find_peer_ctx->last_sent = find_peer_ctx->total;
   GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Sending %u find peer messages (goal 
at least %u connections)\n", find_peer_ctx->total, 
connection_estimate(num_peers, DEFAULT_BUCKET_SIZE));
 
@@ -2021,7 +2024,7 @@
   for (i = 0; i < find_peer_ctx->total; i++)
     {
       test_find_peer = GNUNET_malloc(sizeof(struct TestFindPeer));
-      if (find_peer_ctx->previous_peers == 0) /* If we haven't sent any 
requests, yet choose random peers */
+      if (find_peer_ctx->previous_peers == 0) /* If we haven't sent any 
requests yet, choose random peers */
         {
           /**
            * Attempt to spread find peer requests across even sections of the 
peer address




reply via email to

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