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

[tor-commits] [tor/master] simplify further



commit 5cb82e44d185fff4586ca2b92039e5686b9e753b
Author: Roger Dingledine <arma@xxxxxxxxxxxxxx>
Date:   Thu Mar 29 16:37:50 2012 -0400

    simplify further
---
 src/or/connection_or.c |    7 ++-----
 src/or/dirserv.c       |    9 ++-------
 src/or/dirserv.h       |    3 +--
 3 files changed, 5 insertions(+), 14 deletions(-)

diff --git a/src/or/connection_or.c b/src/or/connection_or.c
index 30d92b2..0d3f9d8 100644
--- a/src/or/connection_or.c
+++ b/src/or/connection_or.c
@@ -1453,7 +1453,6 @@ int
 connection_or_client_learned_peer_id(or_connection_t *conn,
                                      const uint8_t *peer_id)
 {
-  int as_expected = 1;
   const or_options_t *options = get_options();
   int severity = server_mode(options) ? LOG_PROTOCOL_WARN : LOG_WARN;
 
@@ -1492,14 +1491,12 @@ connection_or_client_learned_peer_id(or_connection_t *conn,
       control_event_bootstrap_problem(
                                 "Unexpected identity in router certificate",
                                 END_OR_CONN_REASON_OR_IDENTITY);
-    as_expected = 0;
+    return -1;
   }
   if (authdir_mode_tests_reachability(options)) {
     dirserv_orconn_tls_done(conn->_base.address, conn->_base.port,
-                            (const char*)peer_id, as_expected);
+                            (const char*)peer_id);
   }
-  if (!as_expected)
-    return -1;
 
   return 0;
 }
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index 01a0833..467129c 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -3264,14 +3264,12 @@ dirserv_get_routerdescs(smartlist_t *descs_out, const char *key,
  * router listening at <b>address</b>:<b>or_port</b>, and has yielded
  * a certificate with digest <b>digest_rcvd</b>.
  *
- * If as_advertised is 1, then inform the reachability checker that we
- * could get to this guy.
+ * Inform the reachability checker that we could get to this guy.
  */
 void
 dirserv_orconn_tls_done(const char *address,
                         uint16_t or_port,
-                        const char *digest_rcvd,
-                        int as_advertised)
+                        const char *digest_rcvd)
 {
   routerinfo_t *ri = NULL;
   time_t now = time(NULL);
@@ -3282,9 +3280,6 @@ dirserv_orconn_tls_done(const char *address,
    * addr/port but with nonmatching keys, but instead of dumping, we should
    * skip testing. */
 
-  if (!as_advertised)
-    return;
-
   ri = router_get_mutable_by_digest(digest_rcvd);
   if (ri == NULL)
     return;
diff --git a/src/or/dirserv.h b/src/or/dirserv.h
index 6a86b94..fc48e48 100644
--- a/src/or/dirserv.h
+++ b/src/or/dirserv.h
@@ -108,8 +108,7 @@ int dirserv_get_routerdescs(smartlist_t *descs_out, const char *key,
                             const char **msg);
 void dirserv_orconn_tls_done(const char *address,
                              uint16_t or_port,
-                             const char *digest_rcvd,
-                             int as_advertised);
+                             const char *digest_rcvd);
 int dirserv_should_launch_reachability_test(const routerinfo_t *ri,
                                             const routerinfo_t *ri_old);
 void dirserv_single_reachability_test(time_t now, routerinfo_t *router);



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits