aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2005-09-23 18:08:31 +0000
committerNick Mathewson <nickm@torproject.org>2005-09-23 18:08:31 +0000
commita1f1c4bf6b765c96ff5fce2087f79da243da4145 (patch)
treeafb002308297658efc04743774214e097be89645
parentf995edd5169294af37365c0e3fc62d9a76718512 (diff)
downloadtor-a1f1c4bf6b765c96ff5fce2087f79da243da4145.tar.gz
tor-a1f1c4bf6b765c96ff5fce2087f79da243da4145.zip
Re-enable autosplitting, but authorities and mirrors should not do it, and make the cutoff higher than 1.
svn:r5126
-rw-r--r--src/or/routerlist.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 4e294411dc..8f49624c5a 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -2479,6 +2479,7 @@ update_router_descriptor_downloads(time_t now)
#define MIN_REQUESTS 3
smartlist_t *downloadable = NULL;
int get_all = 0;
+ int always_split = server_mode(get_options()) && get_options()->DirPort;
if (!networkstatus_list || smartlist_len(networkstatus_list)<2)
get_all = 1;
@@ -2491,19 +2492,18 @@ update_router_descriptor_downloads(time_t now)
downloadable = router_list_downloadable();
if (smartlist_len(downloadable)) {
- int i, j, n, n_per_request;
+ int i, j, n, n_per_request=MAX_DL_PER_REQUEST;
size_t r_len = MAX_DL_PER_REQUEST*(HEX_DIGEST_LEN+1)+16;
char *resource = tor_malloc(r_len);
n = smartlist_len(downloadable);
- /*
- n_per_request = (n+MIN_REQUESTS-1) / MIN_REQUESTS;
- if (n_per_request > MAX_DL_PER_REQUEST)
- n_per_request = MAX_DL_PER_REQUEST;
- if (n_per_request < MIN_DL_PER_REQUEST)
- n_per_request = MIN_DL_PER_REQUEST;
- */
- n_per_request = MAX_DL_PER_REQUEST;
+ if (always_split) {
+ n_per_request = (n+MIN_REQUESTS-1) / MIN_REQUESTS;
+ if (n_per_request > MAX_DL_PER_REQUEST)
+ n_per_request = MAX_DL_PER_REQUEST;
+ if (n_per_request < MIN_DL_PER_REQUEST)
+ n_per_request = MIN_DL_PER_REQUEST;
+ }
log_fn(LOG_NOTICE, "Launching %d request%s for %d router%s, %d at a time",
(n+n_per_request-1)/n_per_request, n>n_per_request?"s":"",
n, n>1?"s":"", n_per_request);