aboutsummaryrefslogtreecommitdiff
path: root/src/or/dirvote.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-10-16 15:34:14 +0000
committerNick Mathewson <nickm@torproject.org>2007-10-16 15:34:14 +0000
commit0d26b623eec51e82c8c0475a51493fd5b5f044de (patch)
tree15416783a620ec749a51b579d8a981917d952446 /src/or/dirvote.c
parentc5fb1c19eb9f1a4de223bf96e69f9351d38c6e00 (diff)
downloadtor-0d26b623eec51e82c8c0475a51493fd5b5f044de.tar
tor-0d26b623eec51e82c8c0475a51493fd5b5f044de.tar.gz
r15853@catbus: nickm | 2007-10-16 11:32:55 -0400
Fix "Error adding vote: OK" message. svn:r11986
Diffstat (limited to 'src/or/dirvote.c')
-rw-r--r--src/or/dirvote.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/or/dirvote.c b/src/or/dirvote.c
index 29efcb508..721e8bee1 100644
--- a/src/or/dirvote.c
+++ b/src/or/dirvote.c
@@ -1406,8 +1406,6 @@ dirvote_add_vote(const char *vote_body, const char **msg_out, int *status_out)
log_info(LD_DIR, "Discarding a vote we already have.");
if (*status_out < 200)
*status_out = 200;
- if (!*msg_out)
- *msg_out = "OK";
goto discard;
} else if (v->vote->published < vote->published) {
log_notice(LD_DIR, "Replacing an older pending vote from this "
@@ -1468,8 +1466,14 @@ dirvote_add_vote(const char *vote_body, const char **msg_out, int *status_out)
if (*status_out < 200)
*status_out = 200;
- if (!*msg_out)
- *msg_out = "ok";
+ if (!*msg_out) {
+ if (!any_failed && !pending_vote) {
+ *msg_out = "Duplicate discarded";
+ } else {
+ *msg_out = "ok";
+ }
+ }
+
return any_failed ? NULL : pending_vote;
}