summaryrefslogtreecommitdiff
path: root/src/or/router.c
diff options
context:
space:
mode:
authorKarsten Loesing <karsten.loesing@gmx.net>2009-08-18 15:53:08 +0200
committerKarsten Loesing <karsten.loesing@gmx.net>2009-08-18 15:53:08 +0200
commitdccadb30cd1ceddb9063ba074ba75bf07575e407 (patch)
tree1258117decd8f413dde50e9bb2b6e2cc69cf5c04 /src/or/router.c
parent799af41157c74922a8cc7889510e4b1b040ea215 (diff)
downloadtor-dccadb30cd1ceddb9063ba074ba75bf07575e407.tar.gz
tor-dccadb30cd1ceddb9063ba074ba75bf07575e407.zip
Clean up proposal 166 and its implementation.
Diffstat (limited to 'src/or/router.c')
-rw-r--r--src/or/router.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/or/router.c b/src/or/router.c
index e6d6cc37b2..3249f49ce0 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -1269,6 +1269,7 @@ router_rebuild_descriptor(int force)
uint32_t addr;
char platform[256];
int hibernating = we_are_hibernating();
+ size_t ei_size;
or_options_t *options = get_options();
if (desc_clean_since && !force)
@@ -1382,11 +1383,10 @@ router_rebuild_descriptor(int force)
ei->cache_info.published_on = ri->cache_info.published_on;
memcpy(ei->cache_info.identity_digest, ri->cache_info.identity_digest,
DIGEST_LEN);
- ei->cache_info.signed_descriptor_body =
- tor_malloc(MAX_EXTRAINFO_UPLOAD_SIZE);
+ ei_size = options->ExtraInfoStatistics ? MAX_EXTRAINFO_UPLOAD_SIZE : 8192;
+ ei->cache_info.signed_descriptor_body = tor_malloc(ei_size);
if (extrainfo_dump_to_string(ei->cache_info.signed_descriptor_body,
- MAX_EXTRAINFO_UPLOAD_SIZE,
- ei, get_identity_key()) < 0) {
+ ei_size, ei, get_identity_key()) < 0) {
log_warn(LD_BUG, "Couldn't generate extra-info descriptor.");
extrainfo_free(ei);
return -1;