aboutsummaryrefslogtreecommitdiff
path: root/src/or/router.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2010-11-19 16:13:11 -0500
committerNick Mathewson <nickm@torproject.org>2010-11-19 16:13:11 -0500
commite88486bc9d2f4fd6982a00f5ccf498a4f809cfd2 (patch)
tree5139fd5626216f867d26ca740055cf8e8ee48e55 /src/or/router.c
parent0f1afaf5955e5905b7fd6fcf27d7c9958782bd06 (diff)
downloadtor-e88486bc9d2f4fd6982a00f5ccf498a4f809cfd2.tar
tor-e88486bc9d2f4fd6982a00f5ccf498a4f809cfd2.tar.gz
Add comments to some of the bug2183 fix code
Diffstat (limited to 'src/or/router.c')
-rw-r--r--src/or/router.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/or/router.c b/src/or/router.c
index 38f0a2f47..9b80247f1 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -2044,7 +2044,12 @@ extrainfo_dump_to_string(char **s_out, extrainfo_t *extrainfo,
s = smartlist_join_strings(chunks, "", 0, NULL);
while (strlen(s) > MAX_EXTRAINFO_UPLOAD_SIZE - DIROBJ_MAX_SIG_LEN) {
+ /* So long as there are at least two chunks (one for the initial
+ * extra-info line and one for the router-signature), we can keep removing
+ * things. */
if (smartlist_len(chunks) > 2) {
+ /* We remove the next-to-last element (remember, len-1 is the last
+ element), since we need to keep the router-signature element. */
int idx = smartlist_len(chunks) - 2;
char *e = smartlist_get(chunks, idx);
smartlist_del_keeporder(chunks, idx);