[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r37589 - gnunet/src/transport
From: |
gnunet |
Subject: |
[GNUnet-SVN] r37589 - gnunet/src/transport |
Date: |
Tue, 26 Jul 2016 22:46:05 +0200 |
Author: grothoff
Date: 2016-07-26 22:46:05 +0200 (Tue, 26 Jul 2016)
New Revision: 37589
Modified:
gnunet/src/transport/gnunet-service-transport_clients.c
gnunet/src/transport/gnunet-service-transport_neighbours.c
gnunet/src/transport/transport_api_core.c
Log:
-indentation, logging, style issues
Modified: gnunet/src/transport/gnunet-service-transport_clients.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport_clients.c 2016-07-26
20:39:59 UTC (rev 37588)
+++ gnunet/src/transport/gnunet-service-transport_clients.c 2016-07-26
20:46:05 UTC (rev 37589)
@@ -1383,7 +1383,8 @@
}
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));
}
Modified: gnunet/src/transport/gnunet-service-transport_neighbours.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport_neighbours.c 2016-07-26
20:39:59 UTC (rev 37588)
+++ gnunet/src/transport/gnunet-service-transport_neighbours.c 2016-07-26
20:46:05 UTC (rev 37589)
@@ -516,6 +516,41 @@
/**
+ * 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.
*
* @param n the peer that connected
@@ -628,40 +663,6 @@
/**
- * 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
* to ATS and other subsystems.
Modified: gnunet/src/transport/transport_api_core.c
===================================================================
--- gnunet/src/transport/transport_api_core.c 2016-07-26 20:39:59 UTC (rev
37588)
+++ gnunet/src/transport/transport_api_core.c 2016-07-26 20:46:05 UTC (rev
37589)
@@ -228,6 +228,10 @@
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 @@
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);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r37589 - gnunet/src/transport,
gnunet <=