-getting rid of silly, stupid, useless, often wrong DEFAULTCONFIG setting
[oweals/gnunet.git] / src / ats / ats_api_scheduling.c
index 0ba0e1ceda9bb15fd237ab510266751aa4f0572c..db71d1e1e95a3fafb69e4838e670d3240b609900 100644 (file)
@@ -353,7 +353,7 @@ find_session (struct GNUNET_ATS_SchedulingHandle *sh, uint32_t session_id,
       memcmp (peer, sh->session_array[session_id].session,
               sizeof (struct GNUNET_PeerIdentity)))
   {
-    GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, "ats-scheduling-api",
+    GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "ats-scheduling-api",
               "Session %p belongs to peer `%s'\n",
               sh->session_array[session_id].session, GNUNET_i2s_full ((struct GNUNET_PeerIdentity *)sh->session_array[session_id].session));
 /*
@@ -1065,7 +1065,7 @@ GNUNET_ATS_suggest_address_cancel (struct GNUNET_ATS_SchedulingHandle *sh,
  *
  * @param sh handle
  * @param address the address
- * @param session session handle (if available)
+ * @param session session handle, can be NULL
  * @param ats performance data for the address
  * @param ats_count number of performance records in 'ats'
  * @return GNUNET_OK on success, GNUNET_SYSERR on error
@@ -1091,11 +1091,6 @@ GNUNET_ATS_address_add (struct GNUNET_ATS_SchedulingHandle *sh,
     GNUNET_break (0);
     return GNUNET_SYSERR;
   }
-  if (session == NULL)
-  {
-    GNUNET_break (0);
-    return GNUNET_SYSERR;
-  }
 
   namelen =
       (address->transport_name ==
@@ -1169,7 +1164,7 @@ GNUNET_ATS_address_add (struct GNUNET_ATS_SchedulingHandle *sh,
  *
  * @param sh handle
  * @param address the address
- * @param session session handle (if available)
+ * @param session session handle, can be NULL
  * @param ats performance data for the address
  * @param ats_count number of performance records in 'ats'
  */
@@ -1193,11 +1188,6 @@ GNUNET_ATS_address_update (struct GNUNET_ATS_SchedulingHandle *sh,
     GNUNET_break (0);
     return;
   }
-  if (session == NULL)
-  {
-    GNUNET_break (0);
-    return;
-  }
 
   namelen =
       (address->transport_name ==
@@ -1264,7 +1254,7 @@ GNUNET_ATS_address_update (struct GNUNET_ATS_SchedulingHandle *sh,
  *
  * @param sh handle
  * @param address the address
- * @param session session handle
+ * @param session session handle, can be NULL
  * @param in_use GNUNET_YES if this address is now used, GNUNET_NO
  * if address is not used any more
  */
@@ -1344,7 +1334,7 @@ GNUNET_ATS_address_in_use (struct GNUNET_ATS_SchedulingHandle *sh,
  *
  * @param sh handle
  * @param address the address
- * @param session session handle that is no longer valid
+ * @param session session handle that is no longer valid, can be NULL
  */
 void
 GNUNET_ATS_address_destroyed (struct GNUNET_ATS_SchedulingHandle *sh,
@@ -1358,6 +1348,12 @@ GNUNET_ATS_address_destroyed (struct GNUNET_ATS_SchedulingHandle *sh,
   size_t msize;
   uint32_t s = 0;
 
+  if (address == NULL)
+  {
+    GNUNET_break (0);
+    return;
+  }
+
   GNUNET_assert (address->transport_name != NULL);
   namelen = strlen (address->transport_name) + 1;
   GNUNET_assert (namelen > 1);