gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r36489 - in gnunet/src: include transport
Date: Thu, 8 Oct 2015 18:20:43 +0200

Author: grothoff
Date: 2015-10-08 18:20:42 +0200 (Thu, 08 Oct 2015)
New Revision: 36489

Modified:
   gnunet/src/include/gnunet_constants.h
   gnunet/src/transport/transport_api.c
Log:
add constant for the delay after which we log warnings

Modified: gnunet/src/include/gnunet_constants.h
===================================================================
--- gnunet/src/include/gnunet_constants.h       2015-10-08 16:13:08 UTC (rev 
36488)
+++ gnunet/src/include/gnunet_constants.h       2015-10-08 16:20:42 UTC (rev 
36489)
@@ -72,6 +72,11 @@
 #define GNUNET_CONSTANTS_MAX_CORK_DELAY GNUNET_TIME_relative_multiply 
(GNUNET_TIME_UNIT_SECONDS, 1)
 
 /**
+ * After what amount of latency for a message do we print a warning?
+ */
+#define GNUNET_CONSTANTS_LATENCY_WARN GNUNET_TIME_relative_multiply 
(GNUNET_TIME_UNIT_SECONDS, 1)
+
+/**
  * Until which load do we consider the peer overly idle
  * (which means that we would like to use more resources).<p>
  *

Modified: gnunet/src/transport/transport_api.c
===================================================================
--- gnunet/src/transport/transport_api.c        2015-10-08 16:13:08 UTC (rev 
36488)
+++ gnunet/src/transport/transport_api.c        2015-10-08 16:20:42 UTC (rev 
36489)
@@ -976,7 +976,7 @@
                        size,
                        &cbuf[ret]);
     delay = GNUNET_TIME_absolute_get_duration (th->request_start);
-    if (delay.rel_value_us > 1000 * 1000)
+    if (delay.rel_value_us > GNUNET_CONSTANTS_LATENCY_WARN.rel_value_us)
       LOG (GNUNET_ERROR_TYPE_WARNING,
            "Added %u bytes of control message at %u after %s delay\n",
            nret,
@@ -1055,7 +1055,7 @@
     GNUNET_BANDWIDTH_tracker_consume (&n->out_tracker,
                                       mret);
     delay = GNUNET_TIME_absolute_get_duration (th->request_start);
-    if (delay.rel_value_us > 1000 * 1000)
+    if (delay.rel_value_us > GNUNET_CONSTANTS_LATENCY_WARN.rel_value_us)
       LOG (GNUNET_ERROR_TYPE_WARNING,
            "Added %u bytes of payload message for %s after %s delay at %u 
b/s\n",
            mret,
@@ -2058,7 +2058,7 @@
   n->traffic_overhead = 0;
   if (delay.rel_value_us > timeout.rel_value_us)
     delay.rel_value_us = 0;        /* notify immediately (with failure) */
-  if (delay.rel_value_us > GNUNET_TIME_UNIT_SECONDS.rel_value_us)
+  if (delay.rel_value_us > GNUNET_CONSTANTS_LATENCY_WARN.rel_value_us)
     LOG (GNUNET_ERROR_TYPE_WARNING,
          "At bandwidth %u byte/s next transmission to %s in %s\n",
          (unsigned int) n->out_tracker.available_bytes_per_s__,




reply via email to

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