[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] remove some functions that are not used; #if0 out some file...
Update of /home/or/cvsroot/tor/src/or
In directory moria:/tmp/cvs-serv27544/src/or
Modified Files:
connection_or.c or.h router.c routerlist.c routerparse.c
Log Message:
remove some functions that are not used; #if0 out some files that are not likely to be used.
Index: connection_or.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/connection_or.c,v
retrieving revision 1.198
retrieving revision 1.199
diff -u -d -r1.198 -r1.199
--- connection_or.c 30 Nov 2005 03:01:16 -0000 1.198
+++ connection_or.c 30 Nov 2005 06:27:59 -0000 1.199
@@ -377,40 +377,6 @@
return best;
}
-/** "update an OR connection nickname on the fly"
- * Actually, nobody calls this. Should we remove it? */
-void
-connection_or_update_nickname(connection_t *conn)
-{
- routerinfo_t *r;
- const char *n;
-
- tor_assert(conn);
- tor_assert(conn->type == CONN_TYPE_OR);
- n = dirserv_get_nickname_by_digest(conn->identity_digest);
- if (n) {
- if (!conn->nickname || strcmp(conn->nickname, n)) {
- tor_free(conn->nickname);
- conn->nickname = tor_strdup(n);
- }
- return;
- }
- r = router_get_by_digest(conn->identity_digest);
- if (r && r->is_verified) {
- if (!conn->nickname || strcmp(conn->nickname, r->nickname)) {
- tor_free(conn->nickname);
- conn->nickname = tor_strdup(r->nickname);
- }
- return;
- }
- if (conn->nickname[0] != '$') {
- tor_free(conn->nickname);
- conn->nickname = tor_malloc(HEX_DIGEST_LEN+1);
- base16_encode(conn->nickname, HEX_DIGEST_LEN+1,
- conn->identity_digest, DIGEST_LEN);
- }
-}
-
/** Launch a new OR connection to <b>addr</b>:<b>port</b> and expect to
* handshake with an OR with identity digest <b>id_digest</b>.
*
Index: or.h
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/or.h,v
retrieving revision 1.744
retrieving revision 1.745
diff -u -d -r1.744 -r1.745
--- or.h 30 Nov 2005 03:01:16 -0000 1.744
+++ or.h 30 Nov 2005 06:27:59 -0000 1.745
@@ -1676,7 +1676,6 @@
int connection_tls_continue_handshake(connection_t *conn);
void connection_or_write_cell_to_buf(const cell_t *cell, connection_t *conn);
-void connection_or_update_nickname(connection_t *conn);
/********************************* control.c ***************************/
@@ -1708,8 +1707,6 @@
void control_update_global_event_mask(void);
void control_adjust_event_log_severity(void);
-void disable_control_logging(void);
-void enable_control_logging(void);
/** Execute the statement <b>stmt</b>, which may log events concerning the
* connection <b>conn</b>. To prevent infinite loops, disable log messages
@@ -2060,7 +2057,6 @@
void set_onion_key(crypto_pk_env_t *k);
crypto_pk_env_t *get_onion_key(void);
-crypto_pk_env_t *get_previous_onion_key(void);
time_t get_onion_key_set_at(void);
void set_identity_key(crypto_pk_env_t *k);
crypto_pk_env_t *get_identity_key(void);
@@ -2260,7 +2256,6 @@
int router_parse_runningrouters(const char *str);
int router_parse_directory(const char *str);
routerinfo_t *router_parse_entry_from_string(const char *s, const char *end);
-int router_add_exit_policy_from_string(routerinfo_t *router, const char *s);
addr_policy_t *router_parse_addr_policy_from_string(const char *s,
int assume_action);
version_status_t tor_version_is_obsolete(const char *myversion,
@@ -2270,7 +2265,6 @@
int tor_version_as_new_as(const char *platform, const char *cutoff);
int tor_version_compare(tor_version_t *a, tor_version_t *b);
void assert_addr_policy_ok(addr_policy_t *t);
-void sort_routerstatus_entries(smartlist_t *sl);
networkstatus_t *networkstatus_parse_from_string(const char *s);
Index: router.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/router.c,v
retrieving revision 1.232
retrieving revision 1.233
diff -u -d -r1.232 -r1.233
--- router.c 30 Nov 2005 03:01:16 -0000 1.232
+++ router.c 30 Nov 2005 06:27:59 -0000 1.233
@@ -53,16 +53,6 @@
return onionkey;
}
-/** Return the onion key that was current before the most recent onion
- * key rotation. If no rotation has been performed since this process
- * started, return NULL.
- */
-crypto_pk_env_t *
-get_previous_onion_key(void)
-{
- return lastonionkey;
-}
-
/** Store a copy of the current onion key into *<b>key</b>, and a copy
* of the most recent onion key into *<b>last</b>.
*/
Index: routerlist.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/routerlist.c,v
retrieving revision 1.383
retrieving revision 1.384
diff -u -d -r1.383 -r1.384
--- routerlist.c 30 Nov 2005 03:01:16 -0000 1.383
+++ routerlist.c 30 Nov 2005 06:27:59 -0000 1.384
@@ -507,9 +507,11 @@
mark_all_trusteddirservers_up();
}
+#if 0
/** Return 0 if \\exists an authoritative dirserver that's currently
* thought to be running, else return 1.
*/
+/* XXXX Nobody calls this function. Should it go away? */
int
all_trusted_directory_servers_down(void)
{
@@ -519,6 +521,7 @@
if (dir->is_running) return 0);
return 1;
}
+#endif
/** Add all the family of <b>router</b> to the smartlist <b>sl</b>.
* This is used to make sure we don't pick siblings in a single path.
@@ -1082,7 +1085,9 @@
return sd;
}
+#if 0
/** Allocate a fresh copy of <b>router</b> */
+/* XXX Nobody uses this. Remove it? */
routerinfo_t *
routerinfo_copy(const routerinfo_t *router)
{
@@ -1116,6 +1121,7 @@
}
return r;
}
+#endif
/** Free all storage held by a routerlist <b>rl</b> */
void
Index: routerparse.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/routerparse.c,v
retrieving revision 1.160
retrieving revision 1.161
diff -u -d -r1.160 -r1.161
--- routerparse.c 15 Nov 2005 21:24:32 -0000 1.160
+++ routerparse.c 30 Nov 2005 06:27:59 -0000 1.161
@@ -1079,12 +1079,6 @@
return memcmp(a->identity_digest, b->identity_digest, DIGEST_LEN);
}
-void
-sort_routerstatus_entries(smartlist_t *sl)
-{
- smartlist_sort(sl, _compare_routerstatus_entries);
-}
-
/** Given a versioned (v2 or later) network-status object in <b>s</b>, try to
* parse it and return the result. Return NULL on failure. Check the
* signature of the network status, but do not (yet) check the signing key for
@@ -1319,23 +1313,6 @@
return r;
}
-/** Given an exit policicy stored in <b>s</b>, parse it and add it to the end
- * of the exit policy of <b>router</b>. Return 0 on success, -1 on failure.
- */
-int
-router_add_exit_policy_from_string(routerinfo_t *router, const char *s)
-{
- addr_policy_t *newe, *tmpe;
- newe = router_parse_addr_policy_from_string(s, -1);
- if (!newe)
- return -1;
- for (tmpe = router->exit_policy; tmpe; tmpe=tmpe->next)
- ;
- tmpe->next = newe;
-
- return 0;
-}
-
/** Add an exit policy stored in the token <b>tok</b> to the router info in
* <b>router</b>. Return 0 on success, -1 on failure. */
static int