diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-10-08 16:21:58 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-10-08 16:21:58 +0000 |
commit | 867749d99f90fc49f9033c06e415b2633c459f8b (patch) | |
tree | 68315a8b6002d1d939935bad14ca52ade86954f1 | |
parent | 86a65e51598d4d75320d7fc6b9052e049e618ec3 (diff) | |
download | gnunet-867749d99f90fc49f9033c06e415b2633c459f8b.tar.gz gnunet-867749d99f90fc49f9033c06e415b2633c459f8b.zip |
use constant for overdue warnings
-rw-r--r-- | src/core/gnunet-service-core_neighbours.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/core/gnunet-service-core_neighbours.c b/src/core/gnunet-service-core_neighbours.c index f89206dfe..c89a8f45d 100644 --- a/src/core/gnunet-service-core_neighbours.c +++ b/src/core/gnunet-service-core_neighbours.c | |||
@@ -233,6 +233,7 @@ transmit_ready (void *cls, | |||
233 | size_t ret; | 233 | size_t ret; |
234 | char *cbuf; | 234 | char *cbuf; |
235 | struct GNUNET_TIME_Relative delay; | 235 | struct GNUNET_TIME_Relative delay; |
236 | struct GNUNET_TIME_Relative overdue; | ||
236 | 237 | ||
237 | n->th = NULL; | 238 | n->th = NULL; |
238 | m = n->message_head; | 239 | m = n->message_head; |
@@ -257,21 +258,22 @@ transmit_ready (void *cls, | |||
257 | return 0; | 258 | return 0; |
258 | } | 259 | } |
259 | delay = GNUNET_TIME_absolute_get_duration (m->submission_time); | 260 | delay = GNUNET_TIME_absolute_get_duration (m->submission_time); |
261 | overdue = GNUNET_TIME_absolute_get_duration (m->deadline); | ||
260 | cbuf = buf; | 262 | cbuf = buf; |
261 | GNUNET_assert (size >= m->size); | 263 | GNUNET_assert (size >= m->size); |
262 | memcpy (cbuf, | 264 | memcpy (cbuf, |
263 | &m[1], | 265 | &m[1], |
264 | m->size); | 266 | m->size); |
265 | ret = m->size; | 267 | ret = m->size; |
266 | if (delay.rel_value_us > GNUNET_TIME_UNIT_SECONDS.rel_value_us) | 268 | if (overdue.rel_value_us > GNUNET_CONSTANTS_LATENCY_WARN.rel_value_us) |
267 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 269 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
268 | "Copied message of type %u and size %u into transport buffer for `%s' with delay of %s\n", | 270 | "Copied overdue message of type %u and size %u into transport buffer for `%s' with delay of %s\n", |
269 | (unsigned int) | 271 | (unsigned int) |
270 | ntohs (((struct GNUNET_MessageHeader *) &m[1])->type), | 272 | ntohs (((struct GNUNET_MessageHeader *) &m[1])->type), |
271 | (unsigned int) ret, | 273 | (unsigned int) ret, |
272 | GNUNET_i2s (&n->peer), | 274 | GNUNET_i2s (&n->peer), |
273 | GNUNET_STRINGS_relative_time_to_string (delay, | 275 | GNUNET_STRINGS_relative_time_to_string (delay, |
274 | GNUNET_YES)); | 276 | GNUNET_YES)); |
275 | else | 277 | else |
276 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 278 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
277 | "Copied message of type %u and size %u into transport buffer for `%s' with delay of %s\n", | 279 | "Copied message of type %u and size %u into transport buffer for `%s' with delay of %s\n", |