-indentation, logging, style issues
authorChristian Grothoff <christian@grothoff.org>
Tue, 26 Jul 2016 20:46:05 +0000 (20:46 +0000)
committerChristian Grothoff <christian@grothoff.org>
Tue, 26 Jul 2016 20:46:05 +0000 (20:46 +0000)
src/transport/gnunet-service-transport_clients.c
src/transport/gnunet-service-transport_neighbours.c
src/transport/transport_api_core.c

index 02d2428d3249ab7a961084d2fd4bfbf79bbc05b4..9323b18c379f900e61468818335be2255499bde1 100644 (file)
@@ -1383,7 +1383,8 @@ GST_clients_broadcast (const struct GNUNET_MessageHeader *msg,
   }
   if (GNUNET_NO == done)
     GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-               "Message not delivered, is CORE service up?\n");
+               "Message of type %u not delivered, is CORE service up?\n",
+               ntohs (msg->type));
 }
 
 
index aab4f71e546b64efab603f3ea481533df770c51d..2614c8551df0f6e8b6a3c3a3410384d3e4f00a77 100644 (file)
@@ -515,6 +515,41 @@ print_ack_state (enum GST_ACK_State s)
 }
 
 
+/**
+ * Send information about a new outbound quota to our clients.
+ * Note that the outbound quota is enforced client-side (i.e.
+ * in libgnunettransport).
+ *
+ * @param n affected peer
+ */
+static void
+send_outbound_quota_to_clients (struct NeighbourMapEntry *n)
+{
+  struct QuotaSetMessage q_msg;
+  struct GNUNET_BANDWIDTH_Value32NBO bandwidth_min;
+
+  if (! GNUNET_TRANSPORT_is_connected (n->state))
+    return;
+#if IGNORE_INBOUND_QUOTA
+  bandwidth_min = n->primary_address.bandwidth_out;
+#else
+  bandwidth_min = GNUNET_BANDWIDTH_value_min (n->primary_address.bandwidth_out,
+                                              n->neighbour_receive_quota);
+#endif
+
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "Sending outbound quota of %u Bps for peer `%s' to all clients\n",
+              ntohl (bandwidth_min.value__),
+              GNUNET_i2s (&n->id));
+  q_msg.header.size = htons (sizeof (struct QuotaSetMessage));
+  q_msg.header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_SET_QUOTA);
+  q_msg.quota = bandwidth_min;
+  q_msg.peer = n->id;
+  GST_clients_broadcast (&q_msg.header,
+                        GNUNET_NO);
+}
+
+
 /**
  * Notify our clients that another peer connected to us.
  *
@@ -627,40 +662,6 @@ test_connected (struct NeighbourMapEntry *n)
 }
 
 
-/**
- * Send information about a new outbound quota to our clients.
- * Note that the outbound quota is enforced client-side (i.e.
- * in libgnunettransport).
- *
- * @param n affected peer
- */
-static void
-send_outbound_quota_to_clients (struct NeighbourMapEntry *n)
-{
-  struct QuotaSetMessage q_msg;
-  struct GNUNET_BANDWIDTH_Value32NBO bandwidth_min;
-
-  if (! GNUNET_TRANSPORT_is_connected (n->state))
-    return;
-#if IGNORE_INBOUND_QUOTA
-  bandwidth_min = n->primary_address.bandwidth_out;
-#else
-  bandwidth_min = GNUNET_BANDWIDTH_value_min (n->primary_address.bandwidth_out,
-                                              n->neighbour_receive_quota);
-#endif
-
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Sending outbound quota of %u Bps for peer `%s' to all clients\n",
-              ntohl (bandwidth_min.value__),
-              GNUNET_i2s (&n->id));
-  q_msg.header.size = htons (sizeof (struct QuotaSetMessage));
-  q_msg.header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_SET_QUOTA);
-  q_msg.quota = bandwidth_min;
-  q_msg.peer = n->id;
-  GST_clients_broadcast (&q_msg.header, GNUNET_NO);
-}
-
-
 /**
  * We don't need a given neighbour address any more.
  * Release its resources and give appropriate notifications
index 4ca62d797497b30b52372d5c23926dc36a6f0d04..6be9500fb4f49b60caad1eaa33e8278c64f4e737 100644 (file)
@@ -228,6 +228,10 @@ notify_excess_cb (void *cls)
   struct Neighbour *n = cls;
   struct GNUNET_TRANSPORT_CoreHandle *h = n->h;
 
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Notifying CORE that more bandwidth is available for %s\n",
+       GNUNET_i2s (&n->id));
+
   if (NULL != h->neb_cb)
     h->neb_cb (h->cls,
                &n->id,
@@ -719,7 +723,8 @@ handle_set_quota (void *cls,
   struct GNUNET_TRANSPORT_CoreHandle *h = cls;
   struct Neighbour *n;
 
-  n = neighbour_find (h, &qm->peer);
+  n = neighbour_find (h,
+                     &qm->peer);
   if (NULL == n)
   {
     GNUNET_break (0);