[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r34935 - gnunet/src/transport
From: |
gnunet |
Subject: |
[GNUnet-SVN] r34935 - gnunet/src/transport |
Date: |
Sun, 18 Jan 2015 18:31:14 +0100 |
Author: grothoff
Date: 2015-01-18 18:31:14 +0100 (Sun, 18 Jan 2015)
New Revision: 34935
Modified:
gnunet/src/transport/gnunet-service-transport.c
gnunet/src/transport/gnunet-service-transport_neighbours.c
gnunet/src/transport/gnunet-service-transport_validation.c
Log:
-remarking on things to fix
Modified: gnunet/src/transport/gnunet-service-transport.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport.c 2015-01-18 15:55:20 UTC
(rev 34934)
+++ gnunet/src/transport/gnunet-service-transport.c 2015-01-18 17:31:14 UTC
(rev 34935)
@@ -188,6 +188,7 @@
GST_neighbours_iterate (&transmit_our_hello, (void *) hello);
}
+
/**
* We received some payload. Prepare to pass it on to our clients.
*
@@ -211,7 +212,7 @@
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,
@@ -222,6 +223,7 @@
return ret;
}
+ // FIXME: why is this call here?
GST_ats_add_address (address, session, NULL, 0);
if (GNUNET_YES != do_forward)
@@ -357,6 +359,7 @@
GNUNET_free (blctx);
}
+
/**
* Black list check result for try_connect call
* If connection to the peer is allowed request adddress and
@@ -377,7 +380,9 @@
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)
@@ -671,8 +676,9 @@
*/
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];
@@ -710,14 +716,19 @@
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
*
Modified: gnunet/src/transport/gnunet-service-transport_neighbours.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport_neighbours.c 2015-01-18
15:55:20 UTC (rev 34934)
+++ gnunet/src/transport/gnunet-service-transport_neighbours.c 2015-01-18
17:31:14 UTC (rev 34935)
@@ -3161,6 +3161,8 @@
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);
@@ -3204,6 +3206,7 @@
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 */
@@ -3444,8 +3447,8 @@
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",
@@ -3486,8 +3489,10 @@
/* 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,
@@ -3512,6 +3517,7 @@
return test_connected (lookup_neighbour (target));
}
+
/**
* Change the incoming quota for the given peer.
*
Modified: gnunet/src/transport/gnunet-service-transport_validation.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport_validation.c 2015-01-18
15:55:20 UTC (rev 34934)
+++ gnunet/src/transport/gnunet-service-transport_validation.c 2015-01-18
17:31:14 UTC (rev 34935)
@@ -833,13 +833,13 @@
}
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);
}
@@ -1417,8 +1417,9 @@
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
@@ -1490,6 +1491,7 @@
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)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r34935 - gnunet/src/transport,
gnunet <=