summaryrefslogtreecommitdiff
path: root/src/or/dirvote.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-09-25 23:57:12 +0000
committerNick Mathewson <nickm@torproject.org>2007-09-25 23:57:12 +0000
commit95d97c722a739735382af35e0341546655e2fc57 (patch)
tree5c06edfaffaaa74cd0d4dff02451d4b4ee3d2ef6 /src/or/dirvote.c
parent4d44bf1edcff36f32978eccc78d382d8ae9e1f87 (diff)
downloadtor-95d97c722a739735382af35e0341546655e2fc57.tar.gz
tor-95d97c722a739735382af35e0341546655e2fc57.zip
r15371@catbus: nickm | 2007-09-25 19:53:13 -0400
Always set status_out when adding a vote. svn:r11646
Diffstat (limited to 'src/or/dirvote.c')
-rw-r--r--src/or/dirvote.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/or/dirvote.c b/src/or/dirvote.c
index 10bd273319..1710fb5a04 100644
--- a/src/or/dirvote.c
+++ b/src/or/dirvote.c
@@ -1418,6 +1418,12 @@ dirvote_add_vote(const char *vote_body, const char **msg_out, int *status_out)
v->vote_body = new_cached_dir(tor_strdup(vote_body),
vote->published);
v->vote = vote;
+ if (end_of_vote &&
+ !strcmpstart(end_of_vote, "network-status-version"))
+ goto again;
+
+ if (!*status_out)
+ *status_out = 200;
*msg_out = "ok";
return v;
} else {
@@ -1450,7 +1456,7 @@ dirvote_add_vote(const char *vote_body, const char **msg_out, int *status_out)
networkstatus_vote_free(vote);
if (!*msg_out)
*msg_out = "Error adding vote";
- if (!*status_out)
+ if (!*status_out || *status_out == 200)
*status_out = 400;
if (end_of_vote && !strcmpstart(end_of_vote, "network-status-version "))