diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2010-10-27 09:21:14 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2010-10-27 09:21:14 +0000 |
commit | 71f77f1be3d6e2da1b88fe4a4fdd44c3c69b5325 (patch) | |
tree | 5570130fdab90ad02f4b5bfda414d13161f0f3d1 /src/util/common_logging.c | |
parent | 1d7368a52af332af35ec6de22affef4f5f0c1da4 (diff) | |
download | gnunet-71f77f1be3d6e2da1b88fe4a4fdd44c3c69b5325.tar.gz gnunet-71f77f1be3d6e2da1b88fe4a4fdd44c3c69b5325.zip |
Changed GNUNET_TIME_Absolute and GNUNET_TIME_Relative to allow safe comparisons between time values
Diffstat (limited to 'src/util/common_logging.c')
-rw-r--r-- | src/util/common_logging.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/util/common_logging.c b/src/util/common_logging.c index b17501690..223c92218 100644 --- a/src/util/common_logging.c +++ b/src/util/common_logging.c | |||
@@ -289,7 +289,7 @@ flush_bulk (const char *datestr) | |||
289 | char *last; | 289 | char *last; |
290 | char *ft; | 290 | char *ft; |
291 | 291 | ||
292 | if ((last_bulk_time.value == 0) || (last_bulk_repeat == 0)) | 292 | if ((last_bulk_time.abs_value == 0) || (last_bulk_repeat == 0)) |
293 | return; | 293 | return; |
294 | rev = 0; | 294 | rev = 0; |
295 | last = memchr (last_bulk, '\0', BULK_TRACK_SIZE); | 295 | last = memchr (last_bulk, '\0', BULK_TRACK_SIZE); |
@@ -381,11 +381,11 @@ mylog (enum GNUNET_ErrorType kind, | |||
381 | else | 381 | else |
382 | strcpy (date, "localtime error"); | 382 | strcpy (date, "localtime error"); |
383 | if ((0 != (kind & GNUNET_ERROR_TYPE_BULK)) && | 383 | if ((0 != (kind & GNUNET_ERROR_TYPE_BULK)) && |
384 | (last_bulk_time.value != 0) && | 384 | (last_bulk_time.abs_value != 0) && |
385 | (0 == strncmp (buf, last_bulk, sizeof (last_bulk)))) | 385 | (0 == strncmp (buf, last_bulk, sizeof (last_bulk)))) |
386 | { | 386 | { |
387 | last_bulk_repeat++; | 387 | last_bulk_repeat++; |
388 | if ((GNUNET_TIME_absolute_get_duration (last_bulk_time).value > | 388 | if ((GNUNET_TIME_absolute_get_duration (last_bulk_time).rel_value > |
389 | BULK_DELAY_THRESHOLD) | 389 | BULK_DELAY_THRESHOLD) |
390 | || (last_bulk_repeat > BULK_REPEAT_THRESHOLD)) | 390 | || (last_bulk_repeat > BULK_REPEAT_THRESHOLD)) |
391 | flush_bulk (date); | 391 | flush_bulk (date); |