|
@@ -119,8 +119,12 @@ static smartlist_t *active_linked_connection_lst = NULL;
|
|
static int called_loop_once = 0;
|
|
static int called_loop_once = 0;
|
|
|
|
|
|
|
|
|
|
- * entry to inform the user that Tor is working. */
|
|
+ * entry to inform the user that Tor is working. We set it to 0 when
|
|
-int has_completed_circuit=0;
|
|
+ * we think the fact that we once opened a circuit doesn't mean we can do so
|
|
|
|
+ * any longer (a big time jump happened, when we notice our directory is
|
|
|
|
+ * heinously out-of-date, etc.
|
|
|
|
+ */
|
|
|
|
+int can_complete_circuit=0;
|
|
|
|
|
|
|
|
|
|
* when we have too little directory info? */
|
|
* when we have too little directory info? */
|
|
@@ -714,7 +718,7 @@ directory_info_has_arrived(time_t now, int from_cache)
|
|
}
|
|
}
|
|
|
|
|
|
if (server_mode(options) && !we_are_hibernating() && !from_cache &&
|
|
if (server_mode(options) && !we_are_hibernating() && !from_cache &&
|
|
- (has_completed_circuit || !any_predicted_circuits(now)))
|
|
+ (can_complete_circuit || !any_predicted_circuits(now)))
|
|
consider_testing_reachability(1, 1);
|
|
consider_testing_reachability(1, 1);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1093,7 +1097,7 @@ run_scheduled_events(time_t now)
|
|
|
|
|
|
* 20 minutes of our uptime. */
|
|
* 20 minutes of our uptime. */
|
|
if (server_mode(options) &&
|
|
if (server_mode(options) &&
|
|
- (has_completed_circuit || !any_predicted_circuits(now)) &&
|
|
+ (can_complete_circuit || !any_predicted_circuits(now)) &&
|
|
!we_are_hibernating()) {
|
|
!we_are_hibernating()) {
|
|
if (stats_n_seconds_working < TIMEOUT_UNTIL_UNREACHABILITY_COMPLAINT) {
|
|
if (stats_n_seconds_working < TIMEOUT_UNTIL_UNREACHABILITY_COMPLAINT) {
|
|
consider_testing_reachability(1, dirport_reachability_count==0);
|
|
consider_testing_reachability(1, dirport_reachability_count==0);
|
|
@@ -1192,7 +1196,7 @@ run_scheduled_events(time_t now)
|
|
circuit_close_all_marked();
|
|
circuit_close_all_marked();
|
|
|
|
|
|
|
|
|
|
- if (has_completed_circuit && !we_are_hibernating()) {
|
|
+ if (can_complete_circuit && !we_are_hibernating()) {
|
|
rend_consider_services_upload(now);
|
|
rend_consider_services_upload(now);
|
|
rend_consider_descriptor_republication();
|
|
rend_consider_descriptor_republication();
|
|
}
|
|
}
|
|
@@ -1274,7 +1278,7 @@ second_elapsed_callback(periodic_timer_t *timer, void *arg)
|
|
if (server_mode(options) &&
|
|
if (server_mode(options) &&
|
|
!we_are_hibernating() &&
|
|
!we_are_hibernating() &&
|
|
seconds_elapsed > 0 &&
|
|
seconds_elapsed > 0 &&
|
|
- has_completed_circuit &&
|
|
+ can_complete_circuit &&
|
|
stats_n_seconds_working / TIMEOUT_UNTIL_UNREACHABILITY_COMPLAINT !=
|
|
stats_n_seconds_working / TIMEOUT_UNTIL_UNREACHABILITY_COMPLAINT !=
|
|
(stats_n_seconds_working+seconds_elapsed) /
|
|
(stats_n_seconds_working+seconds_elapsed) /
|
|
TIMEOUT_UNTIL_UNREACHABILITY_COMPLAINT) {
|
|
TIMEOUT_UNTIL_UNREACHABILITY_COMPLAINT) {
|