[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r12630: clean up the dirserv_add_multiple_descriptors() api (tor/trunk/src/or)



Author: arma
Date: 2007-12-01 21:47:42 -0500 (Sat, 01 Dec 2007)
New Revision: 12630

Modified:
   tor/trunk/src/or/directory.c
   tor/trunk/src/or/dirserv.c
Log:
clean up the dirserv_add_multiple_descriptors() api


Modified: tor/trunk/src/or/directory.c
===================================================================
--- tor/trunk/src/or/directory.c	2007-12-01 23:34:43 UTC (rev 12629)
+++ tor/trunk/src/or/directory.c	2007-12-02 02:47:42 UTC (rev 12630)
@@ -2704,12 +2704,12 @@
     if (r > 0)
       dirserv_get_directory(); /* rebuild and write to disk */
     switch (r) {
-      case -2:
       case -1:
+        log_notice(LD_DIRSERV,
+                   "Rejected router descriptor or extra-info from %s (\"%s\").",
+                   conn->_base.address, msg);
+        /* fall through */
       case 1:
-        log_notice(LD_DIRSERV,
-                   "Rejected router descriptor or extra-info from %s.",
-                   conn->_base.address);
         /* malformed descriptor, or something wrong */
         write_http_status_line(conn, 400, msg);
         break;

Modified: tor/trunk/src/or/dirserv.c
===================================================================
--- tor/trunk/src/or/dirserv.c	2007-12-01 23:34:43 UTC (rev 12629)
+++ tor/trunk/src/or/dirserv.c	2007-12-02 02:47:42 UTC (rev 12630)
@@ -627,7 +627,7 @@
  * Return 2 if descriptor is well-formed and accepted;
  *  1 if well-formed and accepted but origin should hear *msg;
  *  0 if well-formed but redundant with one we already have;
- * -1 if it looks vaguely like a router descriptor but rejected;
+ * -1 if it is rejected and origin should hear *msg;
  *
  * This function is only called when fresh descriptors are posted, not when
  * we re-load the cache.