(no commit message)
authorMatthias Wachs <wachs@net.in.tum.de>
Mon, 21 Nov 2011 13:08:42 +0000 (13:08 +0000)
committerMatthias Wachs <wachs@net.in.tum.de>
Mon, 21 Nov 2011 13:08:42 +0000 (13:08 +0000)
src/transport/gnunet-service-transport_neighbours.c

index 3a58887343e67a9ce0e3d142373f9ccf95ed7d2d..e7fa7baf0631ad644e1b03993ab56bd1b33169f6 100644 (file)
@@ -227,6 +227,7 @@ enum Address_State
   FRESH,
 };
 
+
 /**
  * Entry in neighbours.
  */
@@ -245,11 +246,6 @@ struct NeighbourMapEntry
    */
   struct MessageQueue *messages_tail;
 
-  /**
-   * Performance data for the peer.
-   */
-  //struct GNUNET_ATS_Information *ats;
-
   /**
    * Are we currently trying to send a message? If so, which one?
    */
@@ -329,6 +325,7 @@ struct NeighbourMapEntry
    */
   GNUNET_SCHEDULER_TaskIdentifier state_reset;
 
+
   /**
    * How often has the other peer (recently) violated the inbound
    * traffic limit?  Incremented by 10 per violation, decremented by 1
@@ -455,6 +452,8 @@ static void
 reset_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
   struct NeighbourMapEntry *n = cls;
+  if (n == NULL)
+    return;
 
   n->state_reset = GNUNET_SCHEDULER_NO_TASK;
   if (n->state == S_CONNECTED)
@@ -471,8 +470,11 @@ reset_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
   n->state = S_NOT_CONNECTED;
 
   /* destroying address */
-  GNUNET_assert (strlen(n->address->transport_name) > 0); 
-  GNUNET_ATS_address_destroyed (GST_ats, n->address, n->session);
+  if (n->address != NULL)
+  {
+    GNUNET_assert (strlen(n->address->transport_name) > 0);
+    GNUNET_ATS_address_destroyed (GST_ats, n->address, n->session);
+  }
 
   /* request new address */
   if (n->ats_suggest != GNUNET_SCHEDULER_NO_TASK)