diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-04-10 21:05:27 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-04-10 21:05:27 +0000 |
commit | 8a9ac8c92b1fb30c91c700d42e84749cc8aabb68 (patch) | |
tree | 9736e38967822068abd3b8bc01b2d35931e881ff /src/peerinfo | |
parent | 85a049155d73ab1001f417b0786b8aefbdd01fd2 (diff) | |
download | gnunet-8a9ac8c92b1fb30c91c700d42e84749cc8aabb68.tar.gz gnunet-8a9ac8c92b1fb30c91c700d42e84749cc8aabb68.zip |
work on HELLO
Diffstat (limited to 'src/peerinfo')
-rw-r--r-- | src/peerinfo/gnunet-service-peerinfo.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/peerinfo/gnunet-service-peerinfo.c b/src/peerinfo/gnunet-service-peerinfo.c index 5c3f2dfbf..aa2047c7c 100644 --- a/src/peerinfo/gnunet-service-peerinfo.c +++ b/src/peerinfo/gnunet-service-peerinfo.c | |||
@@ -441,6 +441,7 @@ bind_address (const struct GNUNET_PeerIdentity *peer, | |||
441 | char *fn; | 441 | char *fn; |
442 | struct HostEntry *host; | 442 | struct HostEntry *host; |
443 | struct GNUNET_HELLO_Message *mrg; | 443 | struct GNUNET_HELLO_Message *mrg; |
444 | struct GNUNET_TIME_Absolute delta; | ||
444 | 445 | ||
445 | add_host_to_known_hosts (peer); | 446 | add_host_to_known_hosts (peer); |
446 | host = lookup_host_entry (peer); | 447 | host = lookup_host_entry (peer); |
@@ -453,8 +454,14 @@ bind_address (const struct GNUNET_PeerIdentity *peer, | |||
453 | else | 454 | else |
454 | { | 455 | { |
455 | mrg = GNUNET_HELLO_merge (host->hello, hello); | 456 | mrg = GNUNET_HELLO_merge (host->hello, hello); |
456 | /* FIXME: check if old and merged hello are equal, | 457 | delta = GNUNET_HELLO_equals (mrg, |
457 | and if so, bail out early... */ | 458 | host->hello, |
459 | GNUNET_TIME_absolute_get ()); | ||
460 | if (delta.value == GNUNET_TIME_UNIT_FOREVER_ABS.value) | ||
461 | { | ||
462 | GNUNET_free (mrg); | ||
463 | return; | ||
464 | } | ||
458 | GNUNET_free (host->hello); | 465 | GNUNET_free (host->hello); |
459 | host->hello = mrg; | 466 | host->hello = mrg; |
460 | } | 467 | } |