style fixes during debugging
authorChristian Grothoff <christian@grothoff.org>
Mon, 25 Feb 2019 20:42:37 +0000 (21:42 +0100)
committerChristian Grothoff <christian@grothoff.org>
Mon, 25 Feb 2019 20:42:37 +0000 (21:42 +0100)
src/transport/gnunet-service-transport.c
src/transport/gnunet-service-transport_neighbours.c
src/transport/transport_api_core.c

index d3d2a86a344bb5f64f16bae4466bcab797f69640..c621ea686b8d6ff4348b5c6834efd53164117d14 100644 (file)
@@ -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;
index 72c425591a85e7df421f19ee128c70f1ecbeedeb..3472e8ee086c70c117df3f711f1b6d805eee5542 100644 (file)
@@ -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)
index 75287b5e79b36d11c362ac0a06f79d9a4b49f94e..aa6da009844effba6958ebd146740df0b8ad6c38 100644 (file)
@@ -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);
 }