GNUNET_assert(NULL != env->cfg);
GNUNET_assert(NULL != env->stats);
GNUNET_assert(NULL != env->bandwidth_changed_cb);
- GNUNET_assert(NULL != env->get_preferences_cb);
- GNUNET_assert(NULL != env->get_property_cb);
+ GNUNET_assert(NULL != env->get_preferences);
+ GNUNET_assert(NULL != env->get_property);
s = GNUNET_malloc (sizeof (struct GAS_PROPORTIONAL_Handle));
s->env = env;
s->stats = (struct GNUNET_STATISTICS_Handle *) env->stats;
s->bw_changed = env->bandwidth_changed_cb;
s->bw_changed_cls = env->bw_changed_cb_cls;
- s->get_preferences = env->get_preferences_cb;
+ s->get_preferences = env->get_preferences;
s->get_preferences_cls = env->get_preference_cls;
- s->get_properties = env->get_property_cb;
+ s->get_properties = env->get_property;
s->get_properties_cls = env->get_property_cls;
s->network_count = env->network_count;
s->network_entries = GNUNET_malloc (env->network_count * sizeof (struct Network));
if (GNUNET_YES
== GNUNET_CONTAINER_multipeermap_contains (s->requests,
peer))
- GNUNET_CONTAINER_multipeermap_remove (s->requests, peer,
- NULL);
+ GNUNET_assert (GNUNET_OK == GNUNET_CONTAINER_multipeermap_remove (s->requests, peer,
+ NULL));
cur = get_active_address (s,
s->addresses, peer);
GAS_proportional_address_change_network (void *solver,
struct ATS_Address *address, uint32_t current_network, uint32_t new_network)
{
- struct ATS_Address *new;
struct GAS_PROPORTIONAL_Handle *s = (struct GAS_PROPORTIONAL_Handle *) solver;
int save_active = GNUNET_NO;
struct Network *new_net = NULL;
GNUNET_ATS_print_network_type (new_network));
/* Find new address to suggest since no bandwidth in network*/
- if (NULL == (new = (struct ATS_Address *) GAS_proportional_get_preferred_address (s, &address->peer)))
+ if (NULL == GAS_proportional_get_preferred_address (s, &address->peer))
{
/* No alternative address found, disconnect peer */
s->bw_changed (s->bw_changed_cls, address);
LOG(GNUNET_ERROR_TYPE_DEBUG,
"Not enough bandwidth in new network, suggesting alternative address ..\n");
/* Find new address to suggest since no bandwidth in network*/
- if (NULL
- == (new =
- (struct ATS_Address *) GAS_proportional_get_preferred_address (s,
- &address->peer)))
+ if (NULL == GAS_proportional_get_preferred_address (s, &address->peer))
{
/* No alternative address found, disconnect peer */
s->bw_changed (s->bw_changed_cls, address);
struct GAS_PROPORTIONAL_Handle *s = solver;
struct Network *net = NULL;
struct AddressWrapper *aw = NULL;
- const struct ATS_Address *new_address;
GNUNET_assert(NULL != s);
-
net = get_network (s, network);
if (NULL == net)
{
{
if (NULL == get_active_address (s, s->addresses, &address->peer))
{
- if (NULL != (new_address = GAS_proportional_get_preferred_address (s, &address->peer)))
+ if (NULL != GAS_proportional_get_preferred_address (s, &address->peer))
s->bw_changed (s->bw_changed_cls, (struct ATS_Address *) address);
}
}