aboutsummaryrefslogtreecommitdiff
path: root/src/hello
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-05-25 15:53:50 +0000
committerChristian Grothoff <christian@grothoff.org>2010-05-25 15:53:50 +0000
commit2779e988e669631cb977f41ee06da682aa4b7fbf (patch)
treebcae077f7a36890da1d03f56b755c3c4ade75d87 /src/hello
parent27b1cf6f88f5e8ab34338083f1a4cc5e4ada7823 (diff)
downloadgnunet-2779e988e669631cb977f41ee06da682aa4b7fbf.tar.gz
gnunet-2779e988e669631cb977f41ee06da682aa4b7fbf.zip
check that peers match, fix docu
Diffstat (limited to 'src/hello')
-rw-r--r--src/hello/hello.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/hello/hello.c b/src/hello/hello.c
index 5b30dc167..06142535b 100644
--- a/src/hello/hello.c
+++ b/src/hello/hello.c
@@ -570,11 +570,9 @@ find_other_matching (void *cls,
570 addrlen)) ) 570 addrlen)) )
571 { 571 {
572 ec->found = GNUNET_YES; 572 ec->found = GNUNET_YES;
573 if (expiration.value < ec->expiration.value) 573 if (expiration.value < ec->expiration.value)
574 { 574 ec->result = GNUNET_TIME_absolute_min (expiration,
575 ec->result = GNUNET_TIME_absolute_min (expiration, 575 ec->result);
576 ec->result);
577 }
578 return GNUNET_SYSERR; 576 return GNUNET_SYSERR;
579 } 577 }
580 return GNUNET_YES; 578 return GNUNET_YES;
@@ -618,10 +616,10 @@ find_matching (void *cls,
618 * @param h2 the second HELLO message 616 * @param h2 the second HELLO message
619 * @param now time to use for deciding which addresses have 617 * @param now time to use for deciding which addresses have
620 * expired and should not be considered at all 618 * expired and should not be considered at all
621 * @return absolute time zero if the two HELLOs are 619 * @return absolute time forever if the two HELLOs are
622 * totally identical; smallest timestamp >= now if 620 * totally identical; smallest timestamp >= now if
623 * they only differ in timestamps; 621 * they only differ in timestamps;
624 * forever if the some addresses with expirations >= now 622 * zero if the some addresses with expirations >= now
625 * do not match at all 623 * do not match at all
626 */ 624 */
627struct GNUNET_TIME_Absolute 625struct GNUNET_TIME_Absolute
@@ -633,6 +631,10 @@ GNUNET_HELLO_equals (const struct
633{ 631{
634 struct EqualsContext ec; 632 struct EqualsContext ec;
635 633
634 if (0 != memcmp (&h1->publicKey,
635 &h2->publicKey,
636 sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded)))
637 return GNUNET_TIME_UNIT_ZERO_ABS;
636 ec.expiration_limit = now; 638 ec.expiration_limit = now;
637 ec.result = GNUNET_TIME_UNIT_FOREVER_ABS; 639 ec.result = GNUNET_TIME_UNIT_FOREVER_ABS;
638 ec.h2 = h2; 640 ec.h2 = h2;