gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r17313 - gnunet/src/transport


From: gnunet
Subject: [GNUnet-SVN] r17313 - gnunet/src/transport
Date: Mon, 10 Oct 2011 13:20:59 +0200

Author: wachs
Date: 2011-10-10 13:20:59 +0200 (Mon, 10 Oct 2011)
New Revision: 17313

Modified:
   gnunet/src/transport/gnunet-service-transport_neighbours.c
Log:
modifiying transport service


Modified: gnunet/src/transport/gnunet-service-transport_neighbours.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport_neighbours.c  2011-10-10 
11:20:47 UTC (rev 17312)
+++ gnunet/src/transport/gnunet-service-transport_neighbours.c  2011-10-10 
11:20:59 UTC (rev 17313)
@@ -28,6 +28,7 @@
 #include "gnunet-service-transport_neighbours.h"
 #include "gnunet-service-transport_plugins.h"
 #include "gnunet-service-transport_validation.h"
+#include "gnunet-service-transport_clients.h"
 #include "gnunet-service-transport.h"
 #include "gnunet_peerinfo_service.h"
 #include "gnunet_constants.h"
@@ -722,6 +723,7 @@
   n->asc = NULL;
   was_connected = n->is_connected;
   n->is_connected = GNUNET_YES;
+
   GST_neighbours_switch_to_address (target, plugin_name, plugin_address,
                                     plugin_address_len, session, ats,
                                     ats_count);
@@ -729,6 +731,28 @@
     return;
   n->keepalive_task = GNUNET_SCHEDULER_add_now (&neighbour_keepalive_task,
                                                n);
+
+  /* ATS told us inbound quota for this peer */
+#if DEBUG_TRANSPORT
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Setting inbound quota of %u for peer 
`%s' to \n",
+              ntohl (bandwidth_in), GNUNET_i2s (target));
+#endif
+
+
+  GST_neighbours_set_incoming_quota (&n->id, bandwidth_in);
+  /* ATS told us outbound quota for this peer, tell all clients */
+#if DEBUG_TRANSPORT
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending outbound quota of %u Bps for 
peer `%s' to all clients\n",
+              ntohl (bandwidth_out), GNUNET_i2s (target));
+#endif
+
+  struct QuotaSetMessage msg;
+  msg.header.size = htons (sizeof (struct QuotaSetMessage));
+  msg.header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_SET_QUOTA);
+  msg.quota = bandwidth_out;
+  msg.peer = (*target);
+  GST_clients_broadcast ((struct GNUNET_MessageHeader *) &msg, GNUNET_NO);
+
   neighbours_connected++;
   GNUNET_STATISTICS_update (GST_stats, gettext_noop ("# peers connected"), 1,
                             GNUNET_NO);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]