gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r15441 - in gnunet/src: include transport util


From: gnunet
Subject: [GNUnet-SVN] r15441 - in gnunet/src: include transport util
Date: Mon, 6 Jun 2011 13:52:54 +0200

Author: grothoff
Date: 2011-06-06 13:52:54 +0200 (Mon, 06 Jun 2011)
New Revision: 15441

Modified:
   gnunet/src/include/gnunet_server_lib.h
   gnunet/src/transport/gnunet-service-transport.c
   gnunet/src/transport/plugin_transport_tcp.c
   gnunet/src/util/server.c
Log:
disable warning if we intentionally throttle a connection

Modified: gnunet/src/include/gnunet_server_lib.h
===================================================================
--- gnunet/src/include/gnunet_server_lib.h      2011-06-06 11:26:59 UTC (rev 
15440)
+++ gnunet/src/include/gnunet_server_lib.h      2011-06-06 11:52:54 UTC (rev 
15441)
@@ -226,7 +226,17 @@
 void
 GNUNET_SERVER_receive_done (struct GNUNET_SERVER_Client *client, int success);
 
+/**
+ * Disable the warning the server issues if a message is not acknowledged
+ * in a timely fashion.  Use this call if a client is intentionally delayed
+ * for a while.  Only applies to the current message.
+ *
+ * @param client client for which to disable the warning
+ */
+void
+GNUNET_SERVER_disable_receive_done_warning (struct GNUNET_SERVER_Client 
*client);
 
+
 /**
  * Inject a message into the server, pretend it came
  * from the specified client.  Delivery of the message

Modified: gnunet/src/transport/gnunet-service-transport.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport.c     2011-06-06 11:26:59 UTC 
(rev 15440)
+++ gnunet/src/transport/gnunet-service-transport.c     2011-06-06 11:52:54 UTC 
(rev 15441)
@@ -5474,8 +5474,8 @@
   ret = GNUNET_BANDWIDTH_tracker_get_delay (&n->in_tracker, 0);
   if (ret.rel_value > 0)
     {
-#if DEBUG_TRANSPORT || 1
-      GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+#if DEBUG_TRANSPORT 
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                  "Throttling read (%llu bytes excess at %u b/s), waiting %llu 
ms before reading more.\n",
                  (unsigned long long) 
n->in_tracker.consumption_since_last_update__,
                  (unsigned int) n->in_tracker.available_bytes_per_s__,
@@ -5778,8 +5778,8 @@
                                GNUNET_NO);
       return;
     }
-#if DEBUG_TRANSPORT
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+#if DEBUG_TRANSPORT || 1
+  GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
               "Received `%s' request (new quota %u, old quota %u) from client 
for peer `%4s'\n",
               "SET_QUOTA",
              (unsigned int) ntohl (qsm->quota.value__),

Modified: gnunet/src/transport/plugin_transport_tcp.c
===================================================================
--- gnunet/src/transport/plugin_transport_tcp.c 2011-06-06 11:26:59 UTC (rev 
15440)
+++ gnunet/src/transport/plugin_transport_tcp.c 2011-06-06 11:52:54 UTC (rev 
15441)
@@ -2106,13 +2106,14 @@
     }
   else
     {
-#if DEBUG_TCP || 1
-      GNUNET_log_from (GNUNET_ERROR_TYPE_INFO,
+#if DEBUG_TCP 
+      GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG,
                       "tcp",
                       "Throttling receiving from `%s' for %llu ms\n",
                       GNUNET_i2s (&session->target),
                       (unsigned long long) delay.rel_value);
 #endif
+      GNUNET_SERVER_disable_receive_done_warning (client);
       session->receive_delay_task =
        GNUNET_SCHEDULER_add_delayed (delay, &delayed_done, session);
     }

Modified: gnunet/src/util/server.c
===================================================================
--- gnunet/src/util/server.c    2011-06-06 11:26:59 UTC (rev 15440)
+++ gnunet/src/util/server.c    2011-06-06 11:52:54 UTC (rev 15441)
@@ -599,6 +599,24 @@
 
 
 /**
+ * Disable the warning the server issues if a message is not acknowledged
+ * in a timely fashion.  Use this call if a client is intentionally delayed
+ * for a while.  Only applies to the current message.
+ *
+ * @param client client for which to disable the warning
+ */
+void
+GNUNET_SERVER_disable_receive_done_warning (struct GNUNET_SERVER_Client 
*client)
+{
+  if (GNUNET_SCHEDULER_NO_TASK != client->warn_task)
+    {
+      GNUNET_SCHEDULER_cancel (client->warn_task);
+      client->warn_task = GNUNET_SCHEDULER_NO_TASK;
+    }
+}
+
+
+/**
  * Inject a message into the server, pretend it came
  * from the specified client.  Delivery of the message
  * will happen instantly (if a handler is installed;




reply via email to

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