GST_neighbours_iterate (&transmit_our_hello, (void *) hello);
}
+
/**
* We received some payload. Prepare to pass it on to our clients.
*
do_forward = GNUNET_SYSERR;
ret = GST_neighbours_calculate_receive_delay (peer, msg_size, &do_forward);
- if (!GST_neighbours_test_connected (peer))
+ if (! GST_neighbours_test_connected (peer))
{
GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
"Discarded %u bytes type %u payload from peer `%s'\n", msg_size,
return ret;
}
+ // FIXME: why is this call here?
GST_ats_add_address (address, session, NULL, 0);
if (GNUNET_YES != do_forward)
GNUNET_free (blctx);
}
+
/**
* Black list check result for try_connect call
* If connection to the peer is allowed request adddress and
if (GNUNET_OK == result)
{
/* Blacklist allows to speak to this transport */
- GST_ats_add_address(blctx->address, blctx->session, blctx->ats, blctx->ats_count);
+ GST_ats_add_address (blctx->address,
+ blctx->session,
+ blctx->ats, blctx->ats_count);
}
if (NULL != blctx->address)
*/
void
GST_ats_add_address (const struct GNUNET_HELLO_Address *address,
- struct Session *session, const struct GNUNET_ATS_Information *ats,
- uint32_t ats_count)
+ struct Session *session,
+ const struct GNUNET_ATS_Information *ats,
+ uint32_t ats_count)
{
struct GNUNET_TRANSPORT_PluginFunctions *papi;
struct GNUNET_ATS_Information ats2[ats_count + 1];
ats2[0].type = htonl (GNUNET_ATS_NETWORK_TYPE);
ats2[0].value = htonl (net);
memcpy (&ats2[1], ats, sizeof(struct GNUNET_ATS_Information) * ats_count);
- GNUNET_log(GNUNET_ERROR_TYPE_INFO,
- "Notifying ATS about peer `%s''s new address `%s' session %p in network %s\n",
- GNUNET_i2s (&address->peer),
- (0 == address->address_length) ? "<inbound>" : GST_plugins_a2s (address),
- session, GNUNET_ATS_print_network_type (net));
- GNUNET_ATS_address_add (GST_ats, address, session, ats2, ats_count + 1);
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Notifying ATS about peer `%s''s new address `%s' session %p in network %s\n",
+ GNUNET_i2s (&address->peer),
+ (0 == address->address_length)
+ ? "<inbound>"
+ : GST_plugins_a2s (address),
+ session,
+ GNUNET_ATS_print_network_type (net));
+ GNUNET_ATS_address_add (GST_ats, address, session,
+ ats2, ats_count + 1);
}
+
/**
* Notify ATS about property changes to an address
*
n->primary_address.bandwidth_in,
n->primary_address.bandwidth_out);
/* Tell ATS that the outbound session we created to send SYN was successful */
+ // FIXME: shouldn't ATS already know about *outbound* sessions
+ // in particular?
GST_ats_add_address (n->primary_address.address,
n->primary_address.session,
NULL, 0);
GNUNET_break (GNUNET_NO == n->alternative_address.ats_active);
/* Notify about session... perhaps we obtained it */
+ // FIXME: why is this needed?
GST_ats_add_address (n->alternative_address.address,
n->alternative_address.session, NULL, 0);
/* Set primary addresses */
now wait for the ACK to finally be connected
- If we sent a SYN_ACK to this peer before */
- if ( (GNUNET_TRANSPORT_PS_SYN_RECV_ACK != n->state) &&
- (ACK_SEND_ACK != n->ack_state))
+ if ( (GNUNET_TRANSPORT_PS_SYN_RECV_ACK != n->state) &&
+ (ACK_SEND_ACK != n->ack_state))
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
"Received unexpected ACK message from peer `%s' in state %s/%s\n",
/* Add session to ATS since no session was given (NULL) and we may have
* obtained a new session */
- GST_ats_add_address (n->primary_address.address, n->primary_address.session,
- NULL, 0);
+ // FIXME: likely not the best place to do this...
+ GST_ats_add_address (n->primary_address.address,
+ n->primary_address.session,
+ NULL, 0);
/* Set primary address to used */
set_primary_address (n,
return test_connected (lookup_neighbour (target));
}
+
/**
* Change the incoming quota for the given peer.
*
}
ve = find_validation_entry (&public_key, address);
- ve->valid_until = GNUNET_TIME_absolute_max (ve->valid_until, expiration);
-
+ ve->valid_until = GNUNET_TIME_absolute_max (ve->valid_until,
+ expiration);
if (NULL == ve->revalidation_task)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Starting revalidations for valid address `%s'\n",
- GST_plugins_a2s (ve->address));
+ GST_plugins_a2s (ve->address));
ve->next_validation = GNUNET_TIME_absolute_get();
ve->revalidation_task = GNUNET_SCHEDULER_add_now (&revalidate_address, ve);
}
GNUNET_break_op (0);
return GNUNET_SYSERR;
}
- if (GNUNET_TIME_absolute_get_remaining
- (GNUNET_TIME_absolute_ntoh (pong->expiration)).rel_value_us == 0)
+ if (0 ==
+ GNUNET_TIME_absolute_get_remaining
+ (GNUNET_TIME_absolute_ntoh (pong->expiration)).rel_value_us)
{
GNUNET_STATISTICS_update (GST_stats,
gettext_noop
ats[0].value = htonl ((uint32_t) ve->latency.rel_value_us);
ats[1].type = htonl (GNUNET_ATS_NETWORK_TYPE);
ats[1].value = htonl ((uint32_t) ve->network);
+ // FIXME: add vs. update!
GNUNET_ATS_address_add (GST_ats, ve->address, NULL, ats, 2);
}
if (validations_running > 0)