diff options
author | Karsten Loesing <karsten.loesing@gmx.net> | 2013-05-24 09:48:15 +0200 |
---|---|---|
committer | Karsten Loesing <karsten.loesing@gmx.net> | 2013-05-24 10:28:31 +0200 |
commit | b0d4ca4990d50f45a4e0e2805ff471f7408c3007 (patch) | |
tree | 33fe1c7e894c4c92c7bc1d0815daf55a7a5a7543 /src/or/directory.c | |
parent | 1293835440dd4debf6fbfc66e755d9b9384aa362 (diff) | |
download | tor-b0d4ca4990d50f45a4e0e2805ff471f7408c3007.tar.gz tor-b0d4ca4990d50f45a4e0e2805ff471f7408c3007.zip |
Tweak #6752 patch based on comments by nickm.
Diffstat (limited to 'src/or/directory.c')
-rw-r--r-- | src/or/directory.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/or/directory.c b/src/or/directory.c index caf8a55943..88d6717791 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -3723,10 +3723,12 @@ dir_networkstatus_download_failed(smartlist_t *failed, int status_code) } SMARTLIST_FOREACH_END(fp); } -/** Decide which download schedule we want to use, and then return a - * pointer to it along with a pointer to its length. Helper function for - * download_status_increment_failure() and download_status_reset(). */ -static smartlist_t * +/** Decide which download schedule we want to use based on descriptor type + * in <b>dls</b> and whether we are acting as directory <b>server</b>, and + * then return a list of int pointers defining download delays in seconds. + * Helper function for download_status_increment_failure() and + * download_status_reset(). */ +static const smartlist_t * find_dl_schedule_and_len(download_status_t *dls, int server) { switch (dls->schedule) { @@ -3755,7 +3757,7 @@ time_t download_status_increment_failure(download_status_t *dls, int status_code, const char *item, int server, time_t now) { - smartlist_t *schedule; + const smartlist_t *schedule; int increment; tor_assert(dls); if (status_code != 503 || server) { @@ -3803,7 +3805,7 @@ download_status_increment_failure(download_status_t *dls, int status_code, void download_status_reset(download_status_t *dls) { - smartlist_t *schedule = find_dl_schedule_and_len( + const smartlist_t *schedule = find_dl_schedule_and_len( dls, get_options()->DirPort_set); dls->n_download_failures = 0; |