diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-10-16 15:34:14 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-10-16 15:34:14 +0000 |
commit | 0d26b623eec51e82c8c0475a51493fd5b5f044de (patch) | |
tree | 15416783a620ec749a51b579d8a981917d952446 /src/or/dirvote.c | |
parent | c5fb1c19eb9f1a4de223bf96e69f9351d38c6e00 (diff) | |
download | tor-0d26b623eec51e82c8c0475a51493fd5b5f044de.tar.gz tor-0d26b623eec51e82c8c0475a51493fd5b5f044de.zip |
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.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/or/dirvote.c b/src/or/dirvote.c index 29efcb5083..721e8bee1f 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; } |