[or-cvs] fix bugs in compute_recommended_versions

Nick Mathewson nickm at seul.org
Mon Apr 10 08:02:58 UTC 2006


Update of /home/or/cvsroot/tor/src/or
In directory moria:/tmp/cvs-serv2937/src/or

Modified Files:
	routerlist.c 
Log Message:
fix bugs in compute_recommended_versions

Index: routerlist.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/routerlist.c,v
retrieving revision 1.496
retrieving revision 1.497
diff -u -p -d -r1.496 -r1.497
--- routerlist.c	10 Apr 2006 05:48:04 -0000	1.496
+++ routerlist.c	10 Apr 2006 08:02:56 -0000	1.497
@@ -2633,6 +2633,8 @@ compute_recommended_versions(time_t now,
       smartlist_split_string(versions, vers, ",",
                              SPLIT_SKIP_SPACE|SPLIT_IGNORE_BLANK, 0);
       sort_version_list(versions, 1);
+      smartlist_add_all(combined, versions);
+      smartlist_free(versions);
     });
 
   sort_version_list(combined, 0);
@@ -2645,15 +2647,13 @@ compute_recommended_versions(time_t now,
       if (current && !strcmp(cp, current)) {
         ++n_seen;
       } else {
-/* XXX Another case of requiring only half, not more than half -RD */
-        if (n_seen >= n_recent/2 && current)
+        if (n_seen > n_recent/2 && current)
           smartlist_add(recommended, current);
         n_seen = 0;
         current = cp;
       }
     });
-/* XXX and here -RD */
-  if (n_seen >= n_recent/2 && current)
+  if (n_seen > n_recent/2 && current)
     smartlist_add(recommended, current);
 
   result = smartlist_join_strings(recommended, ", ", 0, NULL);
@@ -2752,7 +2752,7 @@ routers_update_all_from_networkstatus(vo
           char *rec = compute_recommended_versions(now, !is_server);
           log_notice(LD_GENERAL, "This version of Tor (%s) is newer than any "
                  "recommended version%s, according to %d/%d recent network "
-                 "statuses.  Versions recommended by at least %d recent "
+                 "statuses.  Versions recommended by more than %d recent "
                  "authorit%s are: %s",
                  VERSION,
                  consensus == VS_NEW_IN_SERIES ? " in its series" : "",



More information about the tor-commits mailing list