diff options
author | Karsten Loesing <karsten.loesing@gmx.net> | 2009-08-18 15:53:08 +0200 |
---|---|---|
committer | Karsten Loesing <karsten.loesing@gmx.net> | 2009-08-18 15:53:08 +0200 |
commit | dccadb30cd1ceddb9063ba074ba75bf07575e407 (patch) | |
tree | 1258117decd8f413dde50e9bb2b6e2cc69cf5c04 /src/or/router.c | |
parent | 799af41157c74922a8cc7889510e4b1b040ea215 (diff) | |
download | tor-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.c | 8 |
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; |