]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Chop out the intro point calculation until it is simple enough for nickm to grok
authorNick Mathewson <nickm@torproject.org>
Tue, 10 Jan 2012 23:50:48 +0000 (18:50 -0500)
committerNick Mathewson <nickm@torproject.org>
Wed, 11 Jan 2012 00:20:00 +0000 (19:20 -0500)
src/or/rendservice.c

index 1f72c6187ae72d69251144d838aa35cee7ae2933..dc51d6829404563585e08f1c140a5e77ad19e15c 100644 (file)
@@ -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;