From fc91704f78af7b7fa18e376a925ba4704b0d72d6 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Wed, 23 Jan 2008 08:38:05 +0000 Subject: [PATCH] Log where uploaded consensus signatures come from svn:r13241 --- src/or/directory.c | 4 ++-- src/or/dirvote.c | 5 +++-- src/or/or.h | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/or/directory.c b/src/or/directory.c index 5b29756a9d..0819c99fe3 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -1565,7 +1565,7 @@ connection_dir_client_reached_eof(dir_connection_t *conn) tor_free(body); tor_free(headers); tor_free(reason); return -1; } - if (dirvote_add_signatures(body, &msg)<0) { + if (dirvote_add_signatures(body, conn->_base.address, &msg)<0) { log_warn(LD_DIR, "Problem adding detached signatures from %s:%d: %s", conn->_base.address, conn->_base.port, msg?msg:"???"); } @@ -2838,7 +2838,7 @@ directory_handle_command_post(dir_connection_t *conn, const char *headers, if (authdir_mode_v3(options) && !strcmp(url,"/tor/post/consensus-signature")) { /* sigs on consensus. */ const char *msg = NULL; - if (dirvote_add_signatures(body, &msg)>=0) { + if (dirvote_add_signatures(body, conn->_base.address, &msg)>=0) { write_http_status_line(conn, 200, msg?msg:"Signatures stored"); } else { log_warn(LD_DIR, "Unable to store signatures posted by %s: %s", diff --git a/src/or/dirvote.c b/src/or/dirvote.c index 328e05aa8a..6f28cea6d7 100644 --- a/src/or/dirvote.c +++ b/src/or/dirvote.c @@ -1823,14 +1823,15 @@ dirvote_add_signatures_to_pending_consensus( * consensus. Return negative on failure, nonnegative on success. */ int dirvote_add_signatures(const char *detached_signatures_body, + const char *source, const char **msg) { if (pending_consensus) { - log_notice(LD_DIR, "Got a signature. Adding it to the pending consensus."); + log_notice(LD_DIR, "Got a signature from %s. Adding it to the pending consensus.", source); return dirvote_add_signatures_to_pending_consensus( detached_signatures_body, msg); } else { - log_notice(LD_DIR, "Got a signature. Queueing it for the next consensus."); + log_notice(LD_DIR, "Got a signature from %s. Queueing it for the next consensus.", source); if (!pending_consensus_signature_list) pending_consensus_signature_list = smartlist_create(); smartlist_add(pending_consensus_signature_list, diff --git a/src/or/or.h b/src/or/or.h index fb61df6880..9d019dc557 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -3176,6 +3176,7 @@ struct pending_vote_t * dirvote_add_vote(const char *vote_body, const char **msg_out, int *status_out); int dirvote_add_signatures(const char *detached_signatures_body, + const char *source, const char **msg_out); /* Item access */