[or-cvs] r13241: Log where uploaded consensus signatures come from (tor/trunk/src/or)

weasel at seul.org weasel at seul.org
Wed Jan 23 08:38:05 UTC 2008


Author: weasel
Date: 2008-01-23 03:38:05 -0500 (Wed, 23 Jan 2008)
New Revision: 13241

Modified:
   tor/trunk/src/or/directory.c
   tor/trunk/src/or/dirvote.c
   tor/trunk/src/or/or.h
Log:
Log where uploaded consensus signatures come from

Modified: tor/trunk/src/or/directory.c
===================================================================
--- tor/trunk/src/or/directory.c	2008-01-23 03:26:21 UTC (rev 13240)
+++ tor/trunk/src/or/directory.c	2008-01-23 08:38:05 UTC (rev 13241)
@@ -1565,7 +1565,7 @@
       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 @@
   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",

Modified: tor/trunk/src/or/dirvote.c
===================================================================
--- tor/trunk/src/or/dirvote.c	2008-01-23 03:26:21 UTC (rev 13240)
+++ tor/trunk/src/or/dirvote.c	2008-01-23 08:38:05 UTC (rev 13241)
@@ -1823,14 +1823,15 @@
  * 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,

Modified: tor/trunk/src/or/or.h
===================================================================
--- tor/trunk/src/or/or.h	2008-01-23 03:26:21 UTC (rev 13240)
+++ tor/trunk/src/or/or.h	2008-01-23 08:38:05 UTC (rev 13241)
@@ -3176,6 +3176,7 @@
                                          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 */



More information about the tor-commits mailing list