diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-08-11 21:21:56 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-08-11 21:21:56 +0000 |
commit | 3d7fefedc9ba60bd8e8448efe8b628446d958536 (patch) | |
tree | 61ce41a52cd6e7232cead77818ef265993b2427e /src/hello | |
parent | 4a0398474db197abed243a123fb971fbeeffab4b (diff) | |
download | gnunet-3d7fefedc9ba60bd8e8448efe8b628446d958536.tar.gz gnunet-3d7fefedc9ba60bd8e8448efe8b628446d958536.zip |
changing time measurement from milliseconds to microseconds
Diffstat (limited to 'src/hello')
-rw-r--r-- | src/hello/hello.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/hello/hello.c b/src/hello/hello.c index d2e143579..a6fe6102f 100644 --- a/src/hello/hello.c +++ b/src/hello/hello.c | |||
@@ -382,8 +382,8 @@ copy_latest (void *cls, const struct GNUNET_HELLO_Address *address, | |||
382 | ec.found = GNUNET_NO; | 382 | ec.found = GNUNET_NO; |
383 | GNUNET_HELLO_iterate_addresses (mc->other, GNUNET_NO, &get_match_exp, &ec); | 383 | GNUNET_HELLO_iterate_addresses (mc->other, GNUNET_NO, &get_match_exp, &ec); |
384 | if ((ec.found == GNUNET_NO) || | 384 | if ((ec.found == GNUNET_NO) || |
385 | (ec.expiration.abs_value < expiration.abs_value) || | 385 | (ec.expiration.abs_value_us < expiration.abs_value_us) || |
386 | ((ec.expiration.abs_value == expiration.abs_value) && | 386 | ((ec.expiration.abs_value_us == expiration.abs_value_us) && |
387 | (mc->take_equal == GNUNET_YES))) | 387 | (mc->take_equal == GNUNET_YES))) |
388 | { | 388 | { |
389 | mc->ret += | 389 | mc->ret += |
@@ -465,8 +465,8 @@ delta_match (void *cls, const struct GNUNET_HELLO_Address *address, | |||
465 | GNUNET_HELLO_iterate_addresses (dc->old_hello, GNUNET_NO, &get_match_exp, | 465 | GNUNET_HELLO_iterate_addresses (dc->old_hello, GNUNET_NO, &get_match_exp, |
466 | &ec); | 466 | &ec); |
467 | if ((ec.found == GNUNET_YES) && | 467 | if ((ec.found == GNUNET_YES) && |
468 | ((ec.expiration.abs_value > expiration.abs_value) || | 468 | ((ec.expiration.abs_value_us > expiration.abs_value_us) || |
469 | (ec.expiration.abs_value >= dc->expiration_limit.abs_value))) | 469 | (ec.expiration.abs_value_us >= dc->expiration_limit.abs_value_us))) |
470 | return GNUNET_YES; /* skip */ | 470 | return GNUNET_YES; /* skip */ |
471 | ret = dc->it (dc->it_cls, address, expiration); | 471 | ret = dc->it (dc->it_cls, address, expiration); |
472 | return ret; | 472 | return ret; |
@@ -609,12 +609,12 @@ find_other_matching (void *cls, const struct GNUNET_HELLO_Address *address, | |||
609 | { | 609 | { |
610 | struct EqualsContext *ec = cls; | 610 | struct EqualsContext *ec = cls; |
611 | 611 | ||
612 | if (expiration.abs_value < ec->expiration_limit.abs_value) | 612 | if (expiration.abs_value_us < ec->expiration_limit.abs_value_us) |
613 | return GNUNET_YES; | 613 | return GNUNET_YES; |
614 | if (0 == GNUNET_HELLO_address_cmp (address, ec->address)) | 614 | if (0 == GNUNET_HELLO_address_cmp (address, ec->address)) |
615 | { | 615 | { |
616 | ec->found = GNUNET_YES; | 616 | ec->found = GNUNET_YES; |
617 | if (expiration.abs_value < ec->expiration.abs_value) | 617 | if (expiration.abs_value_us < ec->expiration.abs_value_us) |
618 | ec->result = GNUNET_TIME_absolute_min (expiration, ec->result); | 618 | ec->result = GNUNET_TIME_absolute_min (expiration, ec->result); |
619 | return GNUNET_SYSERR; | 619 | return GNUNET_SYSERR; |
620 | } | 620 | } |
@@ -628,7 +628,7 @@ find_matching (void *cls, const struct GNUNET_HELLO_Address *address, | |||
628 | { | 628 | { |
629 | struct EqualsContext *ec = cls; | 629 | struct EqualsContext *ec = cls; |
630 | 630 | ||
631 | if (expiration.abs_value < ec->expiration_limit.abs_value) | 631 | if (expiration.abs_value_us < ec->expiration_limit.abs_value_us) |
632 | return GNUNET_YES; | 632 | return GNUNET_YES; |
633 | ec->address = address; | 633 | ec->address = address; |
634 | ec->expiration = expiration; | 634 | ec->expiration = expiration; |
@@ -677,7 +677,7 @@ GNUNET_HELLO_equals (const struct GNUNET_HELLO_Message *h1, | |||
677 | ec.result = GNUNET_TIME_UNIT_FOREVER_ABS; | 677 | ec.result = GNUNET_TIME_UNIT_FOREVER_ABS; |
678 | ec.h2 = h2; | 678 | ec.h2 = h2; |
679 | GNUNET_HELLO_iterate_addresses (h1, GNUNET_NO, &find_matching, &ec); | 679 | GNUNET_HELLO_iterate_addresses (h1, GNUNET_NO, &find_matching, &ec); |
680 | if (ec.result.abs_value == GNUNET_TIME_UNIT_ZERO.rel_value) | 680 | if (ec.result.abs_value_us == GNUNET_TIME_UNIT_ZERO.rel_value_us) |
681 | return ec.result; | 681 | return ec.result; |
682 | ec.h2 = h1; | 682 | ec.h2 = h1; |
683 | GNUNET_HELLO_iterate_addresses (h2, GNUNET_NO, &find_matching, &ec); | 683 | GNUNET_HELLO_iterate_addresses (h2, GNUNET_NO, &find_matching, &ec); |
@@ -707,7 +707,7 @@ GNUNET_HELLO_get_last_expiration (const struct GNUNET_HELLO_Message *msg) | |||
707 | { | 707 | { |
708 | struct GNUNET_TIME_Absolute ret; | 708 | struct GNUNET_TIME_Absolute ret; |
709 | 709 | ||
710 | ret.abs_value = 0; | 710 | ret.abs_value_us = 0; |
711 | GNUNET_HELLO_iterate_addresses (msg, GNUNET_NO, &find_min_expire, &ret); | 711 | GNUNET_HELLO_iterate_addresses (msg, GNUNET_NO, &find_min_expire, &ret); |
712 | return ret; | 712 | return ret; |
713 | } | 713 | } |
@@ -843,7 +843,7 @@ add_address_to_uri (void *cls, const struct GNUNET_HELLO_Address *address, | |||
843 | characters in URIs */ | 843 | characters in URIs */ |
844 | uri_addr = map_characters (addr_dup, "[]", "()"); | 844 | uri_addr = map_characters (addr_dup, "[]", "()"); |
845 | GNUNET_free (addr_dup); | 845 | GNUNET_free (addr_dup); |
846 | seconds = expiration.abs_value / 1000; | 846 | seconds = expiration.abs_value_us / 1000LL / 1000LL; |
847 | t = gmtime (&seconds); | 847 | t = gmtime (&seconds); |
848 | 848 | ||
849 | GNUNET_asprintf (&ret, | 849 | GNUNET_asprintf (&ret, |
@@ -956,7 +956,7 @@ add_address_to_hello (void *cls, size_t max, void *buffer) | |||
956 | GNUNET_break (0); | 956 | GNUNET_break (0); |
957 | return 0; | 957 | return 0; |
958 | } | 958 | } |
959 | expire.abs_value = expiration_seconds * 1000; | 959 | expire.abs_value_us = expiration_seconds * 1000LL * 1000LL; |
960 | } | 960 | } |
961 | if ('!' != tname[0]) | 961 | if ('!' != tname[0]) |
962 | { | 962 | { |