gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r18505 - gnunet/src/nse


From: gnunet
Subject: [GNUnet-SVN] r18505 - gnunet/src/nse
Date: Thu, 8 Dec 2011 13:38:28 +0100

Author: grothoff
Date: 2011-12-08 13:38:28 +0100 (Thu, 08 Dec 2011)
New Revision: 18505

Modified:
   gnunet/src/nse/gnunet-service-nse.c
Log:
fixing issue with sending back size estimate messages to peers that already 
have good estimate information

Modified: gnunet/src/nse/gnunet-service-nse.c
===================================================================
--- gnunet/src/nse/gnunet-service-nse.c 2011-12-08 09:27:43 UTC (rev 18504)
+++ gnunet/src/nse/gnunet-service-nse.c 2011-12-08 12:38:28 UTC (rev 18505)
@@ -105,11 +105,6 @@
 {
 
   /**
-   * Pending message for this peer.
-   */
-  struct GNUNET_MessageHeader *pending_message;
-
-  /**
    * Core handle for sending messages to this peer.
    */
   struct GNUNET_CORE_TransmitHandle *th;
@@ -1077,7 +1072,29 @@
     }
   }
   if (matching_bits == ntohl (size_estimate_messages[idx].matching_bits))
+  {
+    /* cancel transmission in the other direction, as this peer clearly has
+       up-to-date information already */
+    if (idx != estimate_index)
+    {
+      /* do not transmit information for the previous round to this peer 
+        anymore (but allow current round) */
+      peer_entry->previous_round = GNUNET_YES;
+      return GNUNET_OK;
+    }
+    /* got up-to-date information for current round, cancel transmission 
altogether */
+    if (GNUNET_SCHEDULER_NO_TASK != peer_entry->transmit_task)
+    {
+      GNUNET_SCHEDULER_cancel (peer_entry->transmit_task);
+      peer_entry->transmit_task = GNUNET_SCHEDULER_NO_TASK;
+    }
+    if (peer_entry->th != NULL)
+    {
+      GNUNET_CORE_notify_transmit_ready_cancel (peer_entry->th);
+      peer_entry->th = NULL;
+    }
     return GNUNET_OK;
+  }
   if (matching_bits <= ntohl (size_estimate_messages[idx].matching_bits))
   {
     if ((idx < estimate_index) && (peer_entry->previous_round == GNUNET_YES))




reply via email to

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