Loading changes/refactor23814 0 → 100644 +4 −0 Original line number Diff line number Diff line o Code simplification and refactoring: - Remove the old (deterministic) directory retry logic entirely: We've used exponential backoff exclusively for some time. Closes ticket 23814. doc/tor.1.txt +0 −30 Original line number Diff line number Diff line Loading @@ -1757,14 +1757,6 @@ The following options are useful only for clients (that is, if which are advanced by connection failures. (Default: 0, 3, 7, 3600, 10800, 25200, 54000, 111600, 262800) [[ClientBootstrapConsensusMaxDownloadTries]] **ClientBootstrapConsensusMaxDownloadTries** __NUM__:: Try this many times to download a consensus while bootstrapping using fallback directory mirrors before giving up. (Default: 7) [[ClientBootstrapConsensusAuthorityOnlyMaxDownloadTries]] **ClientBootstrapConsensusAuthorityOnlyMaxDownloadTries** __NUM__:: Try this many times to download a consensus while bootstrapping using authorities before giving up. (Default: 4) [[ClientBootstrapConsensusMaxInProgressTries]] **ClientBootstrapConsensusMaxInProgressTries** __NUM__:: Try this many simultaneous connections to download a consensus before waiting for one to complete, timeout, or error out. (Default: 3) Loading Loading @@ -2871,8 +2863,6 @@ The following options are used for running a testing Tor network. 4 (for 40 seconds), 8, 16, 32, 60 ClientBootstrapConsensusAuthorityOnlyDownloadSchedule 0, 1, 4 (for 40 seconds), 8, 16, 32, 60 ClientBootstrapConsensusMaxDownloadTries 80 ClientBootstrapConsensusAuthorityOnlyMaxDownloadTries 80 ClientDNSRejectInternalAddresses 0 ClientRejectInternalAddresses 0 CountPrivateBandwidth 1 Loading @@ -2895,10 +2885,6 @@ The following options are used for running a testing Tor network. TestingBridgeBootstrapDownloadSchedule 0, 0, 5, 10, 15, 20, 30, 60 TestingClientMaxIntervalWithoutRequest 5 seconds TestingDirConnectionMaxStall 30 seconds TestingConsensusMaxDownloadTries 80 TestingDescriptorMaxDownloadTries 80 TestingMicrodescMaxDownloadTries 80 TestingCertMaxDownloadTries 80 TestingEnableConnBwEvent 1 TestingEnableCellStatsEvent 1 TestingEnableTbEmptyEvent 1 Loading Loading @@ -2979,22 +2965,6 @@ The following options are used for running a testing Tor network. Changing this requires that **TestingTorNetwork** is set. (Default: 5 minutes) [[TestingConsensusMaxDownloadTries]] **TestingConsensusMaxDownloadTries** __NUM__:: Try this many times to download a consensus before giving up. Changing this requires that **TestingTorNetwork** is set. (Default: 8) [[TestingDescriptorMaxDownloadTries]] **TestingDescriptorMaxDownloadTries** __NUM__:: Try this often to download a server descriptor before giving up. Changing this requires that **TestingTorNetwork** is set. (Default: 8) [[TestingMicrodescMaxDownloadTries]] **TestingMicrodescMaxDownloadTries** __NUM__:: Try this often to download a microdesc descriptor before giving up. Changing this requires that **TestingTorNetwork** is set. (Default: 8) [[TestingCertMaxDownloadTries]] **TestingCertMaxDownloadTries** __NUM__:: Try this often to download a v3 authority certificate before giving up. Changing this requires that **TestingTorNetwork** is set. (Default: 8) [[TestingDirAuthVoteExit]] **TestingDirAuthVoteExit** __node__,__node__,__...__:: A list of identity fingerprints, country codes, and address patterns of nodes to vote Exit for regardless of their Loading src/or/bridges.c +1 −3 Original line number Diff line number Diff line Loading @@ -458,7 +458,6 @@ bridge_add_from_config(bridge_line_t *bridge_line) if (bridge_line->transport_name) b->transport_name = bridge_line->transport_name; b->fetch_status.schedule = DL_SCHED_BRIDGE; b->fetch_status.backoff = DL_SCHED_RANDOM_EXPONENTIAL; b->fetch_status.increment_on = DL_SCHED_INCREMENT_ATTEMPT; /* We can't reset the bridge's download status here, because UseBridges * might be 0 now, and it might be changed to 1 much later. */ Loading Loading @@ -637,8 +636,7 @@ fetch_bridge_descriptors(const or_options_t *options, time_t now) SMARTLIST_FOREACH_BEGIN(bridge_list, bridge_info_t *, bridge) { /* This resets the download status on first use */ if (!download_status_is_ready(&bridge->fetch_status, now, IMPOSSIBLE_TO_DOWNLOAD)) if (!download_status_is_ready(&bridge->fetch_status, now)) continue; /* don't bother, no need to retry yet */ if (routerset_contains_bridge(options->ExcludeNodes, bridge)) { download_status_mark_impossible(&bridge->fetch_status); Loading src/or/config.c +6 −64 Original line number Diff line number Diff line Loading @@ -645,15 +645,12 @@ static config_var_t option_vars_[] = { "0, 30, 90, 600, 3600, 10800, 25200, 54000, 111600, 262800"), V(TestingClientMaxIntervalWithoutRequest, INTERVAL, "10 minutes"), V(TestingDirConnectionMaxStall, INTERVAL, "5 minutes"), V(TestingConsensusMaxDownloadTries, UINT, "8"), /* Since we try connections rapidly and simultaneously, we can afford * to give up earlier. (This protects against overloading directories.) */ V(ClientBootstrapConsensusMaxDownloadTries, UINT, "7"), /* We want to give up much earlier if we're only using authorities. */ V(ClientBootstrapConsensusAuthorityOnlyMaxDownloadTries, UINT, "4"), V(TestingDescriptorMaxDownloadTries, UINT, "8"), V(TestingMicrodescMaxDownloadTries, UINT, "8"), V(TestingCertMaxDownloadTries, UINT, "8"), OBSOLETE("TestingConsensusMaxDownloadTries"), OBSOLETE("ClientBootstrapConsensusMaxDownloadTries"), OBSOLETE("ClientBootstrapConsensusAuthorityOnlyMaxDownloadTries"), OBSOLETE("TestingDescriptorMaxDownloadTries"), OBSOLETE("TestingMicrodescMaxDownloadTries"), OBSOLETE("TestingCertMaxDownloadTries"), V(TestingDirAuthVoteExit, ROUTERSET, NULL), V(TestingDirAuthVoteExitIsStrict, BOOL, "0"), V(TestingDirAuthVoteGuard, ROUTERSET, NULL), Loading @@ -678,8 +675,6 @@ static const config_var_t testing_tor_network_defaults[] = { "0, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 16, 32, 60"), V(ClientBootstrapConsensusAuthorityOnlyDownloadSchedule, CSV_INTERVAL, "0, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 16, 32, 60"), V(ClientBootstrapConsensusMaxDownloadTries, UINT, "80"), V(ClientBootstrapConsensusAuthorityOnlyMaxDownloadTries, UINT, "80"), V(ClientDNSRejectInternalAddresses, BOOL,"0"), V(ClientRejectInternalAddresses, BOOL, "0"), V(CountPrivateBandwidth, BOOL, "1"), Loading Loading @@ -707,10 +702,6 @@ static const config_var_t testing_tor_network_defaults[] = { "15, 20, 30, 60"), V(TestingClientMaxIntervalWithoutRequest, INTERVAL, "5 seconds"), V(TestingDirConnectionMaxStall, INTERVAL, "30 seconds"), V(TestingConsensusMaxDownloadTries, UINT, "80"), V(TestingDescriptorMaxDownloadTries, UINT, "80"), V(TestingMicrodescMaxDownloadTries, UINT, "80"), V(TestingCertMaxDownloadTries, UINT, "80"), V(TestingEnableConnBwEvent, BOOL, "1"), V(TestingEnableCellStatsEvent, BOOL, "1"), V(TestingEnableTbEmptyEvent, BOOL, "1"), Loading Loading @@ -4418,10 +4409,6 @@ options_validate(or_options_t *old_options, or_options_t *options, CHECK_DEFAULT(TestingBridgeBootstrapDownloadSchedule); CHECK_DEFAULT(TestingClientMaxIntervalWithoutRequest); CHECK_DEFAULT(TestingDirConnectionMaxStall); CHECK_DEFAULT(TestingConsensusMaxDownloadTries); CHECK_DEFAULT(TestingDescriptorMaxDownloadTries); CHECK_DEFAULT(TestingMicrodescMaxDownloadTries); CHECK_DEFAULT(TestingCertMaxDownloadTries); CHECK_DEFAULT(TestingAuthKeyLifetime); CHECK_DEFAULT(TestingLinkCertLifetime); CHECK_DEFAULT(TestingSigningKeySlop); Loading Loading @@ -4496,33 +4483,6 @@ options_validate(or_options_t *old_options, or_options_t *options, COMPLAIN("TestingDirConnectionMaxStall is insanely high."); } if (options->TestingConsensusMaxDownloadTries < 2) { REJECT("TestingConsensusMaxDownloadTries must be greater than 2."); } else if (options->TestingConsensusMaxDownloadTries > 800) { COMPLAIN("TestingConsensusMaxDownloadTries is insanely high."); } if (options->ClientBootstrapConsensusMaxDownloadTries < 2) { REJECT("ClientBootstrapConsensusMaxDownloadTries must be greater " "than 2." ); } else if (options->ClientBootstrapConsensusMaxDownloadTries > 800) { COMPLAIN("ClientBootstrapConsensusMaxDownloadTries is insanely " "high."); } if (options->ClientBootstrapConsensusAuthorityOnlyMaxDownloadTries < 2) { REJECT("ClientBootstrapConsensusAuthorityOnlyMaxDownloadTries must " "be greater than 2." ); } else if ( options->ClientBootstrapConsensusAuthorityOnlyMaxDownloadTries > 800) { COMPLAIN("ClientBootstrapConsensusAuthorityOnlyMaxDownloadTries is " "insanely high."); } if (options->ClientBootstrapConsensusMaxInProgressTries < 1) { REJECT("ClientBootstrapConsensusMaxInProgressTries must be greater " "than 0."); Loading @@ -4532,24 +4492,6 @@ options_validate(or_options_t *old_options, or_options_t *options, "high."); } if (options->TestingDescriptorMaxDownloadTries < 2) { REJECT("TestingDescriptorMaxDownloadTries must be greater than 1."); } else if (options->TestingDescriptorMaxDownloadTries > 800) { COMPLAIN("TestingDescriptorMaxDownloadTries is insanely high."); } if (options->TestingMicrodescMaxDownloadTries < 2) { REJECT("TestingMicrodescMaxDownloadTries must be greater than 1."); } else if (options->TestingMicrodescMaxDownloadTries > 800) { COMPLAIN("TestingMicrodescMaxDownloadTries is insanely high."); } if (options->TestingCertMaxDownloadTries < 2) { REJECT("TestingCertMaxDownloadTries must be greater than 1."); } else if (options->TestingCertMaxDownloadTries > 800) { COMPLAIN("TestingCertMaxDownloadTries is insanely high."); } if (options->TestingEnableConnBwEvent && !options->TestingTorNetwork && !options->UsingTestNetworkDefaults_) { REJECT("TestingEnableConnBwEvent may only be changed in testing " Loading src/or/control.c +9 −30 Original line number Diff line number Diff line Loading @@ -2252,7 +2252,7 @@ digest_list_to_string(const smartlist_t *sl) static char * download_status_to_string(const download_status_t *dl) { char *rv = NULL, *tmp; char *rv = NULL; char tbuf[ISO_TIME_LEN+1]; const char *schedule_str, *want_authority_str; const char *increment_on_str, *backoff_str; Loading Loading @@ -2300,49 +2300,28 @@ download_status_to_string(const download_status_t *dl) break; } switch (dl->backoff) { case DL_SCHED_DETERMINISTIC: backoff_str = "DL_SCHED_DETERMINISTIC"; break; case DL_SCHED_RANDOM_EXPONENTIAL: backoff_str = "DL_SCHED_RANDOM_EXPONENTIAL"; break; default: backoff_str = "unknown"; break; } /* Now assemble them */ tor_asprintf(&tmp, tor_asprintf(&rv, "next-attempt-at %s\n" "n-download-failures %u\n" "n-download-attempts %u\n" "schedule %s\n" "want-authority %s\n" "increment-on %s\n" "backoff %s\n", "backoff %s\n" "last-backoff-position %u\n" "last-delay-used %d\n", tbuf, dl->n_download_failures, dl->n_download_attempts, schedule_str, want_authority_str, increment_on_str, backoff_str); if (dl->backoff == DL_SCHED_RANDOM_EXPONENTIAL) { /* Additional fields become relevant in random-exponential mode */ tor_asprintf(&rv, "%s" "last-backoff-position %u\n" "last-delay-used %d\n", tmp, backoff_str, dl->last_backoff_position, dl->last_delay_used); tor_free(tmp); } else { /* That was it */ rv = tmp; } } return rv; Loading Loading
changes/refactor23814 0 → 100644 +4 −0 Original line number Diff line number Diff line o Code simplification and refactoring: - Remove the old (deterministic) directory retry logic entirely: We've used exponential backoff exclusively for some time. Closes ticket 23814.
doc/tor.1.txt +0 −30 Original line number Diff line number Diff line Loading @@ -1757,14 +1757,6 @@ The following options are useful only for clients (that is, if which are advanced by connection failures. (Default: 0, 3, 7, 3600, 10800, 25200, 54000, 111600, 262800) [[ClientBootstrapConsensusMaxDownloadTries]] **ClientBootstrapConsensusMaxDownloadTries** __NUM__:: Try this many times to download a consensus while bootstrapping using fallback directory mirrors before giving up. (Default: 7) [[ClientBootstrapConsensusAuthorityOnlyMaxDownloadTries]] **ClientBootstrapConsensusAuthorityOnlyMaxDownloadTries** __NUM__:: Try this many times to download a consensus while bootstrapping using authorities before giving up. (Default: 4) [[ClientBootstrapConsensusMaxInProgressTries]] **ClientBootstrapConsensusMaxInProgressTries** __NUM__:: Try this many simultaneous connections to download a consensus before waiting for one to complete, timeout, or error out. (Default: 3) Loading Loading @@ -2871,8 +2863,6 @@ The following options are used for running a testing Tor network. 4 (for 40 seconds), 8, 16, 32, 60 ClientBootstrapConsensusAuthorityOnlyDownloadSchedule 0, 1, 4 (for 40 seconds), 8, 16, 32, 60 ClientBootstrapConsensusMaxDownloadTries 80 ClientBootstrapConsensusAuthorityOnlyMaxDownloadTries 80 ClientDNSRejectInternalAddresses 0 ClientRejectInternalAddresses 0 CountPrivateBandwidth 1 Loading @@ -2895,10 +2885,6 @@ The following options are used for running a testing Tor network. TestingBridgeBootstrapDownloadSchedule 0, 0, 5, 10, 15, 20, 30, 60 TestingClientMaxIntervalWithoutRequest 5 seconds TestingDirConnectionMaxStall 30 seconds TestingConsensusMaxDownloadTries 80 TestingDescriptorMaxDownloadTries 80 TestingMicrodescMaxDownloadTries 80 TestingCertMaxDownloadTries 80 TestingEnableConnBwEvent 1 TestingEnableCellStatsEvent 1 TestingEnableTbEmptyEvent 1 Loading Loading @@ -2979,22 +2965,6 @@ The following options are used for running a testing Tor network. Changing this requires that **TestingTorNetwork** is set. (Default: 5 minutes) [[TestingConsensusMaxDownloadTries]] **TestingConsensusMaxDownloadTries** __NUM__:: Try this many times to download a consensus before giving up. Changing this requires that **TestingTorNetwork** is set. (Default: 8) [[TestingDescriptorMaxDownloadTries]] **TestingDescriptorMaxDownloadTries** __NUM__:: Try this often to download a server descriptor before giving up. Changing this requires that **TestingTorNetwork** is set. (Default: 8) [[TestingMicrodescMaxDownloadTries]] **TestingMicrodescMaxDownloadTries** __NUM__:: Try this often to download a microdesc descriptor before giving up. Changing this requires that **TestingTorNetwork** is set. (Default: 8) [[TestingCertMaxDownloadTries]] **TestingCertMaxDownloadTries** __NUM__:: Try this often to download a v3 authority certificate before giving up. Changing this requires that **TestingTorNetwork** is set. (Default: 8) [[TestingDirAuthVoteExit]] **TestingDirAuthVoteExit** __node__,__node__,__...__:: A list of identity fingerprints, country codes, and address patterns of nodes to vote Exit for regardless of their Loading
src/or/bridges.c +1 −3 Original line number Diff line number Diff line Loading @@ -458,7 +458,6 @@ bridge_add_from_config(bridge_line_t *bridge_line) if (bridge_line->transport_name) b->transport_name = bridge_line->transport_name; b->fetch_status.schedule = DL_SCHED_BRIDGE; b->fetch_status.backoff = DL_SCHED_RANDOM_EXPONENTIAL; b->fetch_status.increment_on = DL_SCHED_INCREMENT_ATTEMPT; /* We can't reset the bridge's download status here, because UseBridges * might be 0 now, and it might be changed to 1 much later. */ Loading Loading @@ -637,8 +636,7 @@ fetch_bridge_descriptors(const or_options_t *options, time_t now) SMARTLIST_FOREACH_BEGIN(bridge_list, bridge_info_t *, bridge) { /* This resets the download status on first use */ if (!download_status_is_ready(&bridge->fetch_status, now, IMPOSSIBLE_TO_DOWNLOAD)) if (!download_status_is_ready(&bridge->fetch_status, now)) continue; /* don't bother, no need to retry yet */ if (routerset_contains_bridge(options->ExcludeNodes, bridge)) { download_status_mark_impossible(&bridge->fetch_status); Loading
src/or/config.c +6 −64 Original line number Diff line number Diff line Loading @@ -645,15 +645,12 @@ static config_var_t option_vars_[] = { "0, 30, 90, 600, 3600, 10800, 25200, 54000, 111600, 262800"), V(TestingClientMaxIntervalWithoutRequest, INTERVAL, "10 minutes"), V(TestingDirConnectionMaxStall, INTERVAL, "5 minutes"), V(TestingConsensusMaxDownloadTries, UINT, "8"), /* Since we try connections rapidly and simultaneously, we can afford * to give up earlier. (This protects against overloading directories.) */ V(ClientBootstrapConsensusMaxDownloadTries, UINT, "7"), /* We want to give up much earlier if we're only using authorities. */ V(ClientBootstrapConsensusAuthorityOnlyMaxDownloadTries, UINT, "4"), V(TestingDescriptorMaxDownloadTries, UINT, "8"), V(TestingMicrodescMaxDownloadTries, UINT, "8"), V(TestingCertMaxDownloadTries, UINT, "8"), OBSOLETE("TestingConsensusMaxDownloadTries"), OBSOLETE("ClientBootstrapConsensusMaxDownloadTries"), OBSOLETE("ClientBootstrapConsensusAuthorityOnlyMaxDownloadTries"), OBSOLETE("TestingDescriptorMaxDownloadTries"), OBSOLETE("TestingMicrodescMaxDownloadTries"), OBSOLETE("TestingCertMaxDownloadTries"), V(TestingDirAuthVoteExit, ROUTERSET, NULL), V(TestingDirAuthVoteExitIsStrict, BOOL, "0"), V(TestingDirAuthVoteGuard, ROUTERSET, NULL), Loading @@ -678,8 +675,6 @@ static const config_var_t testing_tor_network_defaults[] = { "0, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 16, 32, 60"), V(ClientBootstrapConsensusAuthorityOnlyDownloadSchedule, CSV_INTERVAL, "0, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 16, 32, 60"), V(ClientBootstrapConsensusMaxDownloadTries, UINT, "80"), V(ClientBootstrapConsensusAuthorityOnlyMaxDownloadTries, UINT, "80"), V(ClientDNSRejectInternalAddresses, BOOL,"0"), V(ClientRejectInternalAddresses, BOOL, "0"), V(CountPrivateBandwidth, BOOL, "1"), Loading Loading @@ -707,10 +702,6 @@ static const config_var_t testing_tor_network_defaults[] = { "15, 20, 30, 60"), V(TestingClientMaxIntervalWithoutRequest, INTERVAL, "5 seconds"), V(TestingDirConnectionMaxStall, INTERVAL, "30 seconds"), V(TestingConsensusMaxDownloadTries, UINT, "80"), V(TestingDescriptorMaxDownloadTries, UINT, "80"), V(TestingMicrodescMaxDownloadTries, UINT, "80"), V(TestingCertMaxDownloadTries, UINT, "80"), V(TestingEnableConnBwEvent, BOOL, "1"), V(TestingEnableCellStatsEvent, BOOL, "1"), V(TestingEnableTbEmptyEvent, BOOL, "1"), Loading Loading @@ -4418,10 +4409,6 @@ options_validate(or_options_t *old_options, or_options_t *options, CHECK_DEFAULT(TestingBridgeBootstrapDownloadSchedule); CHECK_DEFAULT(TestingClientMaxIntervalWithoutRequest); CHECK_DEFAULT(TestingDirConnectionMaxStall); CHECK_DEFAULT(TestingConsensusMaxDownloadTries); CHECK_DEFAULT(TestingDescriptorMaxDownloadTries); CHECK_DEFAULT(TestingMicrodescMaxDownloadTries); CHECK_DEFAULT(TestingCertMaxDownloadTries); CHECK_DEFAULT(TestingAuthKeyLifetime); CHECK_DEFAULT(TestingLinkCertLifetime); CHECK_DEFAULT(TestingSigningKeySlop); Loading Loading @@ -4496,33 +4483,6 @@ options_validate(or_options_t *old_options, or_options_t *options, COMPLAIN("TestingDirConnectionMaxStall is insanely high."); } if (options->TestingConsensusMaxDownloadTries < 2) { REJECT("TestingConsensusMaxDownloadTries must be greater than 2."); } else if (options->TestingConsensusMaxDownloadTries > 800) { COMPLAIN("TestingConsensusMaxDownloadTries is insanely high."); } if (options->ClientBootstrapConsensusMaxDownloadTries < 2) { REJECT("ClientBootstrapConsensusMaxDownloadTries must be greater " "than 2." ); } else if (options->ClientBootstrapConsensusMaxDownloadTries > 800) { COMPLAIN("ClientBootstrapConsensusMaxDownloadTries is insanely " "high."); } if (options->ClientBootstrapConsensusAuthorityOnlyMaxDownloadTries < 2) { REJECT("ClientBootstrapConsensusAuthorityOnlyMaxDownloadTries must " "be greater than 2." ); } else if ( options->ClientBootstrapConsensusAuthorityOnlyMaxDownloadTries > 800) { COMPLAIN("ClientBootstrapConsensusAuthorityOnlyMaxDownloadTries is " "insanely high."); } if (options->ClientBootstrapConsensusMaxInProgressTries < 1) { REJECT("ClientBootstrapConsensusMaxInProgressTries must be greater " "than 0."); Loading @@ -4532,24 +4492,6 @@ options_validate(or_options_t *old_options, or_options_t *options, "high."); } if (options->TestingDescriptorMaxDownloadTries < 2) { REJECT("TestingDescriptorMaxDownloadTries must be greater than 1."); } else if (options->TestingDescriptorMaxDownloadTries > 800) { COMPLAIN("TestingDescriptorMaxDownloadTries is insanely high."); } if (options->TestingMicrodescMaxDownloadTries < 2) { REJECT("TestingMicrodescMaxDownloadTries must be greater than 1."); } else if (options->TestingMicrodescMaxDownloadTries > 800) { COMPLAIN("TestingMicrodescMaxDownloadTries is insanely high."); } if (options->TestingCertMaxDownloadTries < 2) { REJECT("TestingCertMaxDownloadTries must be greater than 1."); } else if (options->TestingCertMaxDownloadTries > 800) { COMPLAIN("TestingCertMaxDownloadTries is insanely high."); } if (options->TestingEnableConnBwEvent && !options->TestingTorNetwork && !options->UsingTestNetworkDefaults_) { REJECT("TestingEnableConnBwEvent may only be changed in testing " Loading
src/or/control.c +9 −30 Original line number Diff line number Diff line Loading @@ -2252,7 +2252,7 @@ digest_list_to_string(const smartlist_t *sl) static char * download_status_to_string(const download_status_t *dl) { char *rv = NULL, *tmp; char *rv = NULL; char tbuf[ISO_TIME_LEN+1]; const char *schedule_str, *want_authority_str; const char *increment_on_str, *backoff_str; Loading Loading @@ -2300,49 +2300,28 @@ download_status_to_string(const download_status_t *dl) break; } switch (dl->backoff) { case DL_SCHED_DETERMINISTIC: backoff_str = "DL_SCHED_DETERMINISTIC"; break; case DL_SCHED_RANDOM_EXPONENTIAL: backoff_str = "DL_SCHED_RANDOM_EXPONENTIAL"; break; default: backoff_str = "unknown"; break; } /* Now assemble them */ tor_asprintf(&tmp, tor_asprintf(&rv, "next-attempt-at %s\n" "n-download-failures %u\n" "n-download-attempts %u\n" "schedule %s\n" "want-authority %s\n" "increment-on %s\n" "backoff %s\n", "backoff %s\n" "last-backoff-position %u\n" "last-delay-used %d\n", tbuf, dl->n_download_failures, dl->n_download_attempts, schedule_str, want_authority_str, increment_on_str, backoff_str); if (dl->backoff == DL_SCHED_RANDOM_EXPONENTIAL) { /* Additional fields become relevant in random-exponential mode */ tor_asprintf(&rv, "%s" "last-backoff-position %u\n" "last-delay-used %d\n", tmp, backoff_str, dl->last_backoff_position, dl->last_delay_used); tor_free(tmp); } else { /* That was it */ rv = tmp; } } return rv; Loading