sh->reconnect = GNUNET_YES;
return NULL;
}
+ /* This check exploits the fact that first field of a session object
+ * is peer identity.
+ */
+ if (0 !=
+ memcmp (peer, sh->session_array[session_id].session,
+ sizeof (struct GNUNET_PeerIdentity)))
+ {
+ 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));
+/*
+ GNUNET_break (0);
+ sh->reconnect = GNUNET_YES;
+ return NULL;
+*/
+ }
return sh->session_array[session_id].session;
}
*
* @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
GNUNET_break (0);
return GNUNET_SYSERR;
}
- if ((address == NULL) && (session == NULL))
- {
- GNUNET_break (0);
- return GNUNET_SYSERR;
- }
namelen =
(address->transport_name ==
*
* @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'
*/
GNUNET_break (0);
return;
}
- if ((address == NULL) && (session == NULL))
- {
- GNUNET_break (0);
- return;
- }
namelen =
(address->transport_name ==
*
* @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
*/
*
* @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,
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);