summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-01-10 18:50:48 -0500
committerNick Mathewson <nickm@torproject.org>2012-01-10 19:20:00 -0500
commitfe4811471d0ab823ee722f8dd747c87ad48e11de (patch)
tree5f4ba54f1fb96395ba8ad9b2db75a0b6351a5942 /src
parent31d6350737437c61da82647f7ac5a41edaa16c3e (diff)
downloadtor-fe4811471d0ab823ee722f8dd747c87ad48e11de.tar.gz
tor-fe4811471d0ab823ee722f8dd747c87ad48e11de.zip
Chop out the intro point calculation until it is simple enough for nickm to grok
Diffstat (limited to 'src')
-rw-r--r--src/or/rendservice.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/or/rendservice.c b/src/or/rendservice.c
index 1f72c6187a..dc51d68294 100644
--- a/src/or/rendservice.c
+++ b/src/or/rendservice.c
@@ -974,11 +974,14 @@ rend_service_note_removing_intro_point(rend_service_t *service,
* service->n_intro_points_wanted and let rend_services_introduce
* create the new intro points we want (if any).
*/
- double fractional_n_intro_points_wanted_to_replace_this_one =
- (1.5 * ((intro_point_accepted_intro_count(intro) /
- (double)INTRO_POINT_LIFETIME_INTRODUCTIONS) /
- (((double)now - intro->time_published) /
- INTRO_POINT_LIFETIME_MIN_SECONDS)));
+ const double intro_point_usage =
+ intro_point_accepted_intro_count(intro) /
+ (double)(now - intro->time_published);
+ const double intro_point_target_usage =
+ INTRO_POINT_LIFETIME_INTRODUCTIONS /
+ (double)INTRO_POINT_LIFETIME_MIN_SECONDS;
+ const double fractional_n_intro_points_wanted_to_replace_this_one =
+ (1.5 * (intro_point_usage / intro_point_target_usage));
unsigned int n_intro_points_wanted_to_replace_this_one;
unsigned int n_intro_points_wanted_now;
unsigned int n_intro_points_really_wanted_now;