aboutsummaryrefslogtreecommitdiff
path: root/src/topology/gnunet-daemon-topology.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2010-10-27 10:04:42 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2010-10-27 10:04:42 +0000
commitf47cc990ea9a89cb39acc9c6a9789e6474197708 (patch)
treef8301a2b5405ed692592fb98c94d53dc4a9c9151 /src/topology/gnunet-daemon-topology.c
parentabcb868988fd2d754e13ef5122c8ada9c404b273 (diff)
downloadgnunet-f47cc990ea9a89cb39acc9c6a9789e6474197708.tar.gz
gnunet-f47cc990ea9a89cb39acc9c6a9789e6474197708.zip
Refactoring gnunet time
Diffstat (limited to 'src/topology/gnunet-daemon-topology.c')
-rw-r--r--src/topology/gnunet-daemon-topology.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/topology/gnunet-daemon-topology.c b/src/topology/gnunet-daemon-topology.c
index 5425c5e49..fa693f13a 100644
--- a/src/topology/gnunet-daemon-topology.c
+++ b/src/topology/gnunet-daemon-topology.c
@@ -389,7 +389,7 @@ attempt_connect (struct Peer *pos)
389 return; 389 return;
390 if (GNUNET_OK != is_connection_allowed (pos)) 390 if (GNUNET_OK != is_connection_allowed (pos))
391 return; 391 return;
392 if (GNUNET_TIME_absolute_get_remaining (pos->greylisted_until).value > 0) 392 if (GNUNET_TIME_absolute_get_remaining (pos->greylisted_until).rel_value > 0)
393 return; 393 return;
394 if (GNUNET_YES == pos->is_friend) 394 if (GNUNET_YES == pos->is_friend)
395 rem = GREYLIST_AFTER_ATTEMPT_FRIEND; 395 rem = GREYLIST_AFTER_ATTEMPT_FRIEND;
@@ -446,7 +446,7 @@ remove_from_greylist (void *cls,
446 446
447 pos->greylist_clean_task = GNUNET_SCHEDULER_NO_TASK; 447 pos->greylist_clean_task = GNUNET_SCHEDULER_NO_TASK;
448 rem = GNUNET_TIME_absolute_get_remaining (pos->greylisted_until); 448 rem = GNUNET_TIME_absolute_get_remaining (pos->greylisted_until);
449 if (rem.value == 0) 449 if (rem.rel_value == 0)
450 { 450 {
451 attempt_connect (pos); 451 attempt_connect (pos);
452 } 452 }
@@ -586,7 +586,7 @@ find_advertisable_hello (void *cls,
586 if (pos->hello == NULL) 586 if (pos->hello == NULL)
587 return GNUNET_YES; 587 return GNUNET_YES;
588 rst_time = GNUNET_TIME_absolute_get_remaining (pos->filter_expiration); 588 rst_time = GNUNET_TIME_absolute_get_remaining (pos->filter_expiration);
589 if (0 == rst_time.value) 589 if (0 == rst_time.rel_value)
590 { 590 {
591 /* time to discard... */ 591 /* time to discard... */
592 GNUNET_CONTAINER_bloomfilter_free (pos->filter); 592 GNUNET_CONTAINER_bloomfilter_free (pos->filter);
@@ -643,7 +643,7 @@ schedule_next_hello (void *cls,
643 return; 643 return;
644 next_want = GNUNET_HELLO_size (fah.result->hello); 644 next_want = GNUNET_HELLO_size (fah.result->hello);
645 delay = GNUNET_TIME_absolute_get_remaining (pl->next_hello_allowed); 645 delay = GNUNET_TIME_absolute_get_remaining (pl->next_hello_allowed);
646 if (delay.value == 0) 646 if (delay.rel_value == 0)
647 { 647 {
648 /* now! */ 648 /* now! */
649 pl->hello_req = GNUNET_CORE_notify_transmit_ready (handle, 0, 649 pl->hello_req = GNUNET_CORE_notify_transmit_ready (handle, 0,
@@ -733,7 +733,7 @@ connect_notify (void *cls,
733 else 733 else
734 { 734 {
735 GNUNET_assert (GNUNET_NO == pos->is_connected); 735 GNUNET_assert (GNUNET_NO == pos->is_connected);
736 pos->greylisted_until.value = 0; /* remove greylisting */ 736 pos->greylisted_until.abs_value = 0; /* remove greylisting */
737 } 737 }
738 pos->is_connected = GNUNET_YES; 738 pos->is_connected = GNUNET_YES;
739 pos->connect_attempts = 0; /* re-set back-off factor */ 739 pos->connect_attempts = 0; /* re-set back-off factor */
@@ -893,7 +893,7 @@ consider_for_advertising (const struct GNUNET_HELLO_Message *hello)
893 dt = GNUNET_HELLO_equals (peer->hello, 893 dt = GNUNET_HELLO_equals (peer->hello,
894 hello, 894 hello,
895 GNUNET_TIME_absolute_get()); 895 GNUNET_TIME_absolute_get());
896 if (dt.value == GNUNET_TIME_UNIT_FOREVER_ABS.value) 896 if (dt.abs_value == GNUNET_TIME_UNIT_FOREVER_ABS.abs_value)
897 return; /* nothing new here */ 897 return; /* nothing new here */
898 } 898 }
899#if DEBUG_TOPOLOGY 899#if DEBUG_TOPOLOGY
@@ -961,7 +961,7 @@ process_peer (void *cls,
961 } 961 }
962 if ( (! pos->is_connected) && 962 if ( (! pos->is_connected) &&
963 (! pos->is_friend) && 963 (! pos->is_friend) &&
964 (0 == GNUNET_TIME_absolute_get_remaining (pos->greylisted_until).value) ) 964 (0 == GNUNET_TIME_absolute_get_remaining (pos->greylisted_until).rel_value) )
965 free_peer (NULL, &pos->pid.hashPubKey, pos); 965 free_peer (NULL, &pos->pid.hashPubKey, pos);
966 } 966 }
967 return; 967 return;
@@ -981,7 +981,7 @@ process_peer (void *cls,
981#endif 981#endif
982 return; 982 return;
983 } 983 }
984 if (GNUNET_TIME_absolute_get_remaining (pos->greylisted_until).value > 0) 984 if (GNUNET_TIME_absolute_get_remaining (pos->greylisted_until).rel_value > 0)
985 { 985 {
986#if DEBUG_TOPOLOGY 986#if DEBUG_TOPOLOGY
987 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 987 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,