xvine:fixes
[oweals/gnunet.git] / src / dv / gnunet-service-dv.c
index 70a55494cabb155338ec3eb3268c8facde509f4b..abade848fe77017d20bfaf0231d0dca918d9f7d5 100644 (file)
@@ -637,7 +637,7 @@ core_transmit_notify (void *cls, size_t size, void *buf)
     dn->cth =
       GNUNET_CORE_notify_transmit_ready (core_api,
                                         GNUNET_YES /* cork */,
-                                        0 /* priority */,
+                                        GNUNET_CORE_PRIO_BEST_EFFORT,
                                         GNUNET_TIME_UNIT_FOREVER_REL,
                                         &dn->peer,
                                         msize,
@@ -705,7 +705,7 @@ forward_payload (struct DirectNeighbor *target,
   if (NULL == target->cth)
     target->cth = GNUNET_CORE_notify_transmit_ready (core_api,
                                                     GNUNET_YES /* cork */,
-                                                    0 /* priority */,
+                                                    GNUNET_CORE_PRIO_BEST_EFFORT,
                                                     GNUNET_TIME_UNIT_FOREVER_REL,
                                                     &target->peer,
                                                     msize,
@@ -1302,7 +1302,10 @@ handle_direct_disconnect (struct DirectNeighbor *neighbor)
  *
  * @param cls closure
  * @param address the address
- * @param active is this address in active use
+ * @param active #GNUNET_YES if this address is actively used
+ *        to maintain a connection to a peer;
+ *        #GNUNET_NO if the address is not actively used;
+ *        #GNUNET_SYSERR if this address is no longer available for ATS
  * @param bandwidth_out assigned outbound bandwidth for the connection
  * @param bandwidth_in assigned inbound bandwidth for the connection
  * @param ats performance data for the address (as far as known)
@@ -1321,8 +1324,17 @@ handle_ats_update (void *cls,
   uint32_t distance;
   enum GNUNET_ATS_Network_Type network = GNUNET_ATS_NET_UNSPECIFIED;
 
-  if (GNUNET_NO == active)
+  if (NULL == address)
+  {
+    /* ATS service temporarily disconnected */
+    return;
+  }
+
+  if (GNUNET_YES != active)
+  {
+    // FIXME: handle disconnect/inactive case too!
     return;
+  }
   distance = get_atsi_distance (ats, ats_count);
   network = get_atsi_network (ats, ats_count);
   GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != network);