gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r21467 - gnunet/src/transport


From: gnunet
Subject: [GNUnet-SVN] r21467 - gnunet/src/transport
Date: Sun, 13 May 2012 21:17:29 +0200

Author: grothoff
Date: 2012-05-13 21:17:29 +0200 (Sun, 13 May 2012)
New Revision: 21467

Modified:
   gnunet/src/transport/gnunet-service-transport_neighbours.c
Log:
-fixing #2347

Modified: gnunet/src/transport/gnunet-service-transport_neighbours.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport_neighbours.c  2012-05-13 
19:16:38 UTC (rev 21466)
+++ gnunet/src/transport/gnunet-service-transport_neighbours.c  2012-05-13 
19:17:29 UTC (rev 21467)
@@ -890,6 +890,19 @@
 
 
 /**
+ * Master task run for every neighbour.  Performs all of the time-related
+ * activities (keep alive, send next message, disconnect if idle, finish
+ * clean up after disconnect).
+ *
+ * @param cls the 'struct NeighbourMapEntry' for which we are running
+ * @param tc scheduler context (unused)
+ */
+static void
+master_task (void *cls,
+            const struct GNUNET_SCHEDULER_TaskContext *tc);
+
+
+/**
  * Function called when the 'DISCONNECT' message has been sent by the
  * plugin.  Frees the neighbour --- if the entry still exists.
  *
@@ -908,8 +921,9 @@
     return; /* already gone */
   if (S_DISCONNECT != n->state)
     return; /* have created a fresh entry since */
-  n->state = S_DISCONNECT_FINISHED;
-  free_neighbour (n);
+  n->state = S_DISCONNECT;
+  GNUNET_SCHEDULER_cancel (n->task);
+  n->task = GNUNET_SCHEDULER_add_now (&master_task, n);
 }
 
 
@@ -956,19 +970,6 @@
 
 
 /**
- * Master task run for every neighbour.  Performs all of the time-related
- * activities (keep alive, send next message, disconnect if idle, finish
- * clean up after disconnect).
- *
- * @param cls the 'struct NeighbourMapEntry' for which we are running
- * @param tc scheduler context (unused)
- */
-static void
-master_task (void *cls,
-            const struct GNUNET_SCHEDULER_TaskContext *tc);
-
-
-/**
  * Disconnect from the given neighbour, clean up the record.
  *
  * @param n neighbour to disconnect from
@@ -2425,6 +2426,8 @@
                               1, GNUNET_NO);
     break;    
   case S_CONNECT_SENT:
+    if (ts.abs_value != n->primary_address.connect_timestamp.abs_value)
+      break; /* ACK does not match our original CONNECT message */
     n->state = S_CONNECTED;
     n->timeout = GNUNET_TIME_relative_to_absolute 
(GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT);
     GNUNET_STATISTICS_set (GST_stats, 




reply via email to

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