diff options
author | Fergus Dall <fergus@beware.dropbear.id.au> | 2016-01-13 06:49:56 +1030 |
---|---|---|
committer | Fergus Dall <fergus@beware.dropbear.id.au> | 2016-01-13 06:57:24 +1030 |
commit | 91077d3aca2ea027816f4ea733bb8193dd60a2f2 (patch) | |
tree | d977d4bfbd51afe6b46e5e62c7ad553b67cdb1a2 | |
parent | d062baac86c824f8a3ddfead3a8c88b3f87068c1 (diff) | |
download | tor-91077d3aca2ea027816f4ea733bb8193dd60a2f2.tar.gz tor-91077d3aca2ea027816f4ea733bb8193dd60a2f2.zip |
Update the limits in max_dl_per_request for IPv6 address length
-rw-r--r-- | changes/17573 | 3 | ||||
-rw-r--r-- | src/or/routerlist.c | 13 |
2 files changed, 13 insertions, 3 deletions
diff --git a/changes/17573 b/changes/17573 new file mode 100644 index 0000000000..fe1fd1c027 --- /dev/null +++ b/changes/17573 @@ -0,0 +1,3 @@ + o Minor bigfixes (IPv6): + - Update the limits in max_dl_per_request for IPv6 address + length. Closes ticket 17573. diff --git a/src/or/routerlist.c b/src/or/routerlist.c index 853c07d58c..8edab2c634 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -4440,13 +4440,20 @@ static int max_dl_per_request(const or_options_t *options, int purpose) { /* Since squid does not like URLs >= 4096 bytes we limit it to 96. - * 4096 - strlen(http://255.255.255.255/tor/server/d/.z) == 4058 - * 4058/41 (40 for the hash and 1 for the + that separates them) => 98 + * 4096 - strlen(http://ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff + * /tor/server/d/.z) == 4034 + * 4034/41 (40 for the hash and 1 for the + that separates them) => 98 * So use 96 because it's a nice number. + * + * For microdescriptors, the calculation is + * 4096 - strlen(http://ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff + * /tor/micro/d/.z) == 4035 + * 4035/44 (43 for the hash and 1 for the - that separates them) => 91 + * So use 90 because it's a nice number. */ int max = 96; if (purpose == DIR_PURPOSE_FETCH_MICRODESC) { - max = 92; + max = 90; } /* If we're going to tunnel our connections, we can ask for a lot more * in a request. */ |