gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r18082 - in gnunet/src: ats transport


From: gnunet
Subject: [GNUnet-SVN] r18082 - in gnunet/src: ats transport
Date: Wed, 9 Nov 2011 21:37:11 +0100

Author: wachs
Date: 2011-11-09 21:37:11 +0100 (Wed, 09 Nov 2011)
New Revision: 18082

Modified:
   gnunet/src/ats/gnunet-service-ats_scheduling.c
   gnunet/src/transport/gnunet-service-transport_neighbours.c
Log:
checking quotas


Modified: gnunet/src/ats/gnunet-service-ats_scheduling.c
===================================================================
--- gnunet/src/ats/gnunet-service-ats_scheduling.c      2011-11-09 17:45:19 UTC 
(rev 18081)
+++ gnunet/src/ats/gnunet-service-ats_scheduling.c      2011-11-09 20:37:11 UTC 
(rev 18082)
@@ -141,6 +141,10 @@
   addrp = (char *) &atsp[atsi_count];
   memcpy (addrp, plugin_addr, plugin_addr_len);
   strcpy (&addrp[plugin_addr_len], plugin_name);
+
+  GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "ATS sends quota for peer `%s': 
(in/out) %u/%u\n",
+      GNUNET_i2s (peer), ntohl (bandwidth_in.value__), 
ntohl(bandwidth_out.value__));
+
   GNUNET_SERVER_notification_context_unicast (nc, my_client, &msg->header,
                                               GNUNET_YES);
 }

Modified: gnunet/src/transport/gnunet-service-transport_neighbours.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport_neighbours.c  2011-11-09 
17:45:19 UTC (rev 18081)
+++ gnunet/src/transport/gnunet-service-transport_neighbours.c  2011-11-09 
20:37:11 UTC (rev 18082)
@@ -1249,18 +1249,18 @@
        (n->session == session) )
   {
     struct QuotaSetMessage q_msg;
+
+    n->bandwidth_in = bandwidth_in;
+    n->bandwidth_out = bandwidth_out;
+    GST_neighbours_set_incoming_quota (&n->id, n->bandwidth_in);
     
 #if DEBUG_TRANSPORT
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-               "Sending outbound quota of %u Bps and inbound quota of %u Bps 
for peer `%s' to all clients\n",
-               ntohl (n->bandwidth_out.value__),
-               ntohl (n->bandwidth_in.value__), GNUNET_i2s (peer));
 #endif
+    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                "Sending outbound quota of %u Bps and inbound quota of %u Bps 
for peer `%s' to all clients\n",
+                ntohl (n->bandwidth_out.value__),
+                ntohl (n->bandwidth_in.value__), GNUNET_i2s (peer));
     
-    n->bandwidth_in = bandwidth_in;
-    n->bandwidth_out = bandwidth_out;
-    GST_neighbours_set_incoming_quota (&n->id, n->bandwidth_in);
-    
     q_msg.header.size = htons (sizeof (struct QuotaSetMessage));
     q_msg.header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_SET_QUOTA);
     q_msg.quota = n->bandwidth_out;
@@ -1794,6 +1794,10 @@
                               1, GNUNET_NO);
     return;
   }
+  GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+              "Setting inbound quota of %u Bps for peer `%s' to all clients\n",
+              ntohl (quota.value__), GNUNET_i2s (&n->id));
+
   GNUNET_BANDWIDTH_tracker_update_quota (&n->in_tracker, quota);
   if (0 != ntohl (quota.value__))
     return;
@@ -2043,11 +2047,7 @@
                                  n->session,
                                  GNUNET_YES);
   GNUNET_ATS_address_in_use (GST_ats, n->address, n->session, GNUNET_YES);
-#if DEBUG_TRANSPORT
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Setting inbound quota of %u for peer `%s' to \n",
-              ntohl (n->bandwidth_in.value__), GNUNET_i2s (&n->id));
-#endif
+
   GST_neighbours_set_incoming_quota (&n->id, n->bandwidth_in);
 
   /* send ACK (ACK) */
@@ -2086,10 +2086,11 @@
   connect_notify_cb (callback_cls, &n->id, ats, ats_count);  
 
 #if DEBUG_TRANSPORT
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+#endif
+  GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
               "Sending outbound quota of %u Bps for peer `%s' to all 
clients\n",
               ntohl (n->bandwidth_out.value__), GNUNET_i2s (peer));
-#endif
+
   q_msg.header.size = htons (sizeof (struct QuotaSetMessage));
   q_msg.header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_SET_QUOTA);
   q_msg.quota = n->bandwidth_out;
@@ -2170,10 +2171,11 @@
 #endif
   connect_notify_cb (callback_cls, &n->id, ats, ats_count);  
 #if DEBUG_TRANSPORT
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+#endif
+  GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
               "Sending outbound quota of %u Bps for peer `%s' to all 
clients\n",
               ntohl (n->bandwidth_out.value__), GNUNET_i2s (peer));
-#endif
+
   q_msg.header.size = htons (sizeof (struct QuotaSetMessage));
   q_msg.header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_SET_QUOTA);
   q_msg.quota = n->bandwidth_out;




reply via email to

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