summaryrefslogtreecommitdiff
path: root/src/transport
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-02-25 21:42:37 +0100
committerChristian Grothoff <christian@grothoff.org>2019-02-25 21:42:37 +0100
commit3cb49e832b2f4237bfb895720b4d3c3dbcf881e5 (patch)
tree7488a0887e77a1ce9f349dea6048f2efe4749c9c /src/transport
parentb660cf48f0e34cffb13f0f6cad26f691d4e41aab (diff)
style fixes during debugging
Diffstat (limited to 'src/transport')
-rw-r--r--src/transport/gnunet-service-transport.c12
-rw-r--r--src/transport/gnunet-service-transport_neighbours.c9
-rw-r--r--src/transport/transport_api_core.c10
3 files changed, 17 insertions, 14 deletions
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c
index d3d2a86a3..c621ea686 100644
--- a/src/transport/gnunet-service-transport.c
+++ b/src/transport/gnunet-service-transport.c
@@ -1341,7 +1341,6 @@ void
GST_clients_broadcast (const struct GNUNET_MessageHeader *msg,
int may_drop)
{
- struct TransportClient *tc;
int done;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -1349,7 +1348,9 @@ GST_clients_broadcast (const struct GNUNET_MessageHeader *msg,
(unsigned int) ntohs (msg->type),
(unsigned int) ntohs (msg->size));
done = GNUNET_NO;
- for (tc = clients_head; NULL != tc; tc = tc->next)
+ for (struct TransportClient *tc = clients_head;
+ NULL != tc;
+ tc = tc->next)
{
if ( (GNUNET_YES == may_drop) &&
(CT_CORE != tc->type) )
@@ -1382,13 +1383,14 @@ GST_clients_broadcast_peer_notification (const struct GNUNET_PeerIdentity *peer,
{
struct GNUNET_MQ_Envelope *env;
struct PeerIterateResponseMessage *msg;
- struct TransportClient *tc;
-
+
msg = compose_address_iterate_response_message (peer,
address);
msg->state = htonl (state);
msg->state_timeout = GNUNET_TIME_absolute_hton (state_timeout);
- for (tc = clients_head; NULL != tc; tc = tc->next)
+ for (struct TransportClient *tc = clients_head;
+ NULL != tc;
+ tc = tc->next)
{
if (CT_MONITOR != tc->type)
continue;
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c
index 72c425591..3472e8ee0 100644
--- a/src/transport/gnunet-service-transport_neighbours.c
+++ b/src/transport/gnunet-service-transport_neighbours.c
@@ -713,7 +713,7 @@ set_state_and_timeout (struct NeighbourMapEntry *n,
struct GNUNET_TIME_Absolute timeout)
{
if (GNUNET_TRANSPORT_is_connected (s) &&
- ! GNUNET_TRANSPORT_is_connected (n->state) )
+ (! GNUNET_TRANSPORT_is_connected (n->state)) )
{
neighbours_connect_notification (n);
GNUNET_STATISTICS_set (GST_stats,
@@ -721,8 +721,8 @@ set_state_and_timeout (struct NeighbourMapEntry *n,
++neighbours_connected,
GNUNET_NO);
}
- if (! GNUNET_TRANSPORT_is_connected (s) &&
- GNUNET_TRANSPORT_is_connected (n->state) )
+ if ((! GNUNET_TRANSPORT_is_connected (s)) &&
+ GNUNET_TRANSPORT_is_connected (n->state) )
{
GNUNET_STATISTICS_set (GST_stats,
gettext_noop ("# peers connected"),
@@ -948,7 +948,8 @@ free_neighbour (struct NeighbourMapEntry *n)
}
GNUNET_assert (GNUNET_YES ==
GNUNET_CONTAINER_multipeermap_remove (neighbours,
- &n->id, n));
+ &n->id,
+ n));
/* Cancel address requests for this peer */
if (NULL != n->suggest_handle)
diff --git a/src/transport/transport_api_core.c b/src/transport/transport_api_core.c
index 75287b5e7..aa6da0098 100644
--- a/src/transport/transport_api_core.c
+++ b/src/transport/transport_api_core.c
@@ -747,18 +747,18 @@ handle_set_quota (void *cls,
struct GNUNET_TRANSPORT_CoreHandle *h = cls;
struct Neighbour *n;
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ "Receiving SET_QUOTA message for `%s' with quota %u\n",
+ GNUNET_i2s (&qm->peer),
+ ntohl (qm->quota.value__));
n = neighbour_find (h,
&qm->peer);
if (NULL == n)
{
- GNUNET_break (0);
+ GNUNET_break (0); /* FIXME: julius reports this assertion fails sometimes? */
disconnect_and_schedule_reconnect (h);
return;
}
- LOG (GNUNET_ERROR_TYPE_DEBUG,
- "Receiving SET_QUOTA message for `%s' with quota %u\n",
- GNUNET_i2s (&qm->peer),
- ntohl (qm->quota.value__));
GNUNET_BANDWIDTH_tracker_update_quota (&n->out_tracker,
qm->quota);
}