gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r36491 - gnunet/src/core


From: gnunet
Subject: [GNUnet-SVN] r36491 - gnunet/src/core
Date: Thu, 8 Oct 2015 18:21:58 +0200

Author: grothoff
Date: 2015-10-08 18:21:58 +0200 (Thu, 08 Oct 2015)
New Revision: 36491

Modified:
   gnunet/src/core/gnunet-service-core_neighbours.c
Log:
use constant for overdue warnings

Modified: gnunet/src/core/gnunet-service-core_neighbours.c
===================================================================
--- gnunet/src/core/gnunet-service-core_neighbours.c    2015-10-08 16:20:50 UTC 
(rev 36490)
+++ gnunet/src/core/gnunet-service-core_neighbours.c    2015-10-08 16:21:58 UTC 
(rev 36491)
@@ -233,6 +233,7 @@
   size_t ret;
   char *cbuf;
   struct GNUNET_TIME_Relative delay;
+  struct GNUNET_TIME_Relative overdue;
 
   n->th = NULL;
   m = n->message_head;
@@ -257,6 +258,7 @@
     return 0;
   }
   delay = GNUNET_TIME_absolute_get_duration (m->submission_time);
+  overdue = GNUNET_TIME_absolute_get_duration (m->deadline);
   cbuf = buf;
   GNUNET_assert (size >= m->size);
   memcpy (cbuf,
@@ -263,15 +265,15 @@
           &m[1],
           m->size);
   ret = m->size;
-  if (delay.rel_value_us > GNUNET_TIME_UNIT_SECONDS.rel_value_us)
-  GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-              "Copied message of type %u and size %u into transport buffer for 
`%s' with delay of %s\n",
-              (unsigned int)
-              ntohs (((struct GNUNET_MessageHeader *) &m[1])->type),
-              (unsigned int) ret,
-              GNUNET_i2s (&n->peer),
-              GNUNET_STRINGS_relative_time_to_string (delay,
-                                                      GNUNET_YES));
+  if (overdue.rel_value_us > GNUNET_CONSTANTS_LATENCY_WARN.rel_value_us)
+    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+                "Copied overdue message of type %u and size %u into transport 
buffer for `%s' with delay of %s\n",
+                (unsigned int)
+                ntohs (((struct GNUNET_MessageHeader *) &m[1])->type),
+                (unsigned int) ret,
+                GNUNET_i2s (&n->peer),
+                GNUNET_STRINGS_relative_time_to_string (delay,
+                                                        GNUNET_YES));
   else
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                 "Copied message of type %u and size %u into transport buffer 
for `%s' with delay of %s\n",




reply via email to

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