summaryrefslogtreecommitdiff
path: root/src/or/rephist.c
diff options
context:
space:
mode:
authorKarsten Loesing <karsten.loesing@gmx.net>2010-11-13 22:25:19 +0100
committerKarsten Loesing <karsten.loesing@gmx.net>2010-11-15 12:51:51 +0100
commitcec21652a7c939d1112591347e35c0815de63f93 (patch)
tree2e751f82e99229b9fb2044e4fc21d7bc9b169952 /src/or/rephist.c
parentdbba84c917279c8c58b1bfdac37fbcdfd84b7bb7 (diff)
downloadtor-cec21652a7c939d1112591347e35c0815de63f93.tar.gz
tor-cec21652a7c939d1112591347e35c0815de63f93.zip
Try harder not to exceed the 50 KB extra-info descriptor limit.
Our checks that we don't exceed the 50 KB size limit of extra-info descriptors apparently failed. This patch fixes these checks and reserves another 250 bytes for appending the signature. Fixes bug 2183.
Diffstat (limited to 'src/or/rephist.c')
-rw-r--r--src/or/rephist.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/or/rephist.c b/src/or/rephist.c
index 056fc5cc12..22b3ec5217 100644
--- a/src/or/rephist.c
+++ b/src/or/rephist.c
@@ -1440,7 +1440,7 @@ rep_hist_fill_bandwidth_history(char *buf, size_t len, bw_array_t *b)
* history in its descriptor.
*/
char *
-rep_hist_get_bandwidth_lines(int for_extrainfo)
+rep_hist_get_bandwidth_lines(void)
{
char *buf, *cp;
char t[ISO_TIME_LEN+1];
@@ -1474,9 +1474,8 @@ rep_hist_get_bandwidth_lines(int for_extrainfo)
}
tor_assert(b);
format_iso_time(t, b->next_period-NUM_SECS_BW_SUM_INTERVAL);
- tor_snprintf(cp, len-(cp-buf), "%s%s %s (%d s) ",
- for_extrainfo ? "" : "opt ", desc, t,
- NUM_SECS_BW_SUM_INTERVAL);
+ tor_snprintf(cp, len-(cp-buf), "%s %s (%d s) ",
+ desc, t, NUM_SECS_BW_SUM_INTERVAL);
cp += strlen(cp);
cp += rep_hist_fill_bandwidth_history(cp, len-(cp-buf), b);
strlcat(cp, "\n", len-(cp-buf));