directory writes. Previously, we had only counted this when we
had met our limits precisely. Fixes bug 824. Patch from by rovv.
Bugfix on 0.2.0.x (??).
+ - Avoid a 0/0 calculation when calculating router uptime at directory
+ authorities. Bugfix on 0.2.0.8-alpha.
o Minor bugfixes (controller):
- Make DNS resolved events into "CLOSED", not "FAILED". Bugfix on
} else if (hist->start_of_downtime) {
total += (when - hist->start_of_downtime);
}
+
+ if (!total) {
+ /* Avoid calling anybody's uptime infinity (which should be impossible if
+ * the code is working), or NaN (which can happen for any router we haven't
+ * observed up or down yet). */
+ return 0.0;
+ }
+
return ((double) up) / total;
}