Remove code that has been #if-0ed for a long time.

svn:r4435
This commit is contained in:
Nick Mathewson 2005-06-15 18:34:46 +00:00
parent e8331f9d7d
commit d4972bd2e1
9 changed files with 1 additions and 134 deletions

View file

@ -1237,22 +1237,6 @@ static void init_dh_param(void) {
tor_assert(p); tor_assert(p);
tor_assert(g); tor_assert(g);
#if 0
/* This is from draft-ietf-ipsec-ike-modp-groups-05.txt. It's a safe
prime, and supposedly it equals:
2^1536 - 2^1472 - 1 + 2^64 * { [2^1406 pi] + 741804 }
*/
r = BN_hex2bn(&p,
"FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1"
"29024E088A67CC74020BBEA63B139B22514A08798E3404DD"
"EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245"
"E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED"
"EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D"
"C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F"
"83655D23DCA3AD961C62F356208552BB9ED529077096966D"
"670C354E4ABC9804F1746C08CA237327FFFFFFFFFFFFFFFF");
#endif
/* This is from rfc2409, section 6.2. It's a safe prime, and /* This is from rfc2409, section 6.2. It's a safe prime, and
supposedly it equals: supposedly it equals:
2^1024 - 2^960 - 1 + 2^64 * { [2^894 pi] + 129093 }. 2^1024 - 2^960 - 1 + 2^64 * { [2^894 pi] + 129093 }.

View file

@ -899,12 +899,6 @@ new_route_len(double cw, uint8_t purpose, smartlist_t *routers)
tor_fragile_assert(); tor_fragile_assert();
return -1; return -1;
} }
#endif
#if 0
for (routelen = 3; ; routelen++) { /* 3, increment until coinflip says we're done */
if (crypto_pseudo_rand_int(255) >= cw*255) /* don't extend */
break;
}
#endif #endif
log_fn(LOG_DEBUG,"Chosen route length %d (%d routers available).",routelen, log_fn(LOG_DEBUG,"Chosen route length %d (%d routers available).",routelen,
smartlist_len(routers)); smartlist_len(routers));

View file

@ -285,9 +285,6 @@ options_act(void)
or_options_t *options = get_options(); or_options_t *options = get_options();
static int libevent_initialized = 0; static int libevent_initialized = 0;
/* XXXX009 We once had a reason to separate start_daemon and finish_daemon:
* It let us have the parent process stick around until we were sure Tor
* was started. Should we make start_daemon get called earlier? -NM */
if (options->RunAsDaemon) { if (options->RunAsDaemon) {
start_daemon(); start_daemon();
} }
@ -396,18 +393,6 @@ options_act(void)
return -1; return -1;
} }
#if 0
{
char *smin, *smax;
smin = config_dump_options(options, 1);
smax = config_dump_options(options, 0);
log_fn(LOG_DEBUG, "These are our options:\n%s",smax);
log_fn(LOG_DEBUG, "We changed these options:\n%s",smin);
tor_free(smin);
tor_free(smax);
}
#endif
/* Since our options changed, we might need to regenerate and upload our /* Since our options changed, we might need to regenerate and upload our
* server descriptor. (We could probably be more clever about only calling * server descriptor. (We could probably be more clever about only calling
* this when something significant changed.) * this when something significant changed.)
@ -1502,11 +1487,6 @@ options_validate(or_options_t *options)
log(LOG_WARN,"BandwidthBurst must be at least equal to BandwidthRate."); log(LOG_WARN,"BandwidthBurst must be at least equal to BandwidthRate.");
result = -1; result = -1;
} }
#if 0
if (2*options->BandwidthRate > options->BandwidthBurst) {
log(LOG_NOTICE,"You have chosen a BandwidthBurst less than twice BandwidthRate. Please consider setting your BandwidthBurst higher (at least %d), to provide better service to the Tor network.", (int)(2*options->BandwidthRate));
}
#endif
if (options->_MonthlyAccountingStart) { if (options->_MonthlyAccountingStart) {
if (options->AccountingStart) { if (options->AccountingStart) {
@ -2437,12 +2417,6 @@ validate_data_directory(or_options_t *options)
log_fn(LOG_ERR, "DataDirectory is too long."); log_fn(LOG_ERR, "DataDirectory is too long.");
return -1; return -1;
} }
#if 0
if (check_private_dir(options->DataDirectory, CPD_CHECK != 0)) {
log_fn(LOG_WARN, "Can't create directory %s", options->DataDirectory);
return -1;
}
#endif
return 0; return 0;
} }

View file

@ -1792,13 +1792,6 @@ assert_connection_ok(connection_t *conn, time_t now)
assert_buf_ok(conn->outbuf); assert_buf_ok(conn->outbuf);
} }
#if 0 /* computers often go back in time; no way to know */
tor_assert(!now || conn->timestamp_lastread <= now);
tor_assert(!now || conn->timestamp_lastwritten <= now);
tor_assert(conn->timestamp_created <= conn->timestamp_lastread);
tor_assert(conn->timestamp_created <= conn->timestamp_lastwritten);
#endif
/* XXX Fix this; no longer so.*/ /* XXX Fix this; no longer so.*/
#if 0 #if 0
if (conn->type != CONN_TYPE_OR && conn->type != CONN_TYPE_DIR) if (conn->type != CONN_TYPE_OR && conn->type != CONN_TYPE_DIR)

View file

@ -810,6 +810,7 @@ addressmap_register_virtual_address(int type, char *new_address)
#if 0 #if 0
{ {
/* Try to catch possible bugs */
addressmap_entry_t *ent; addressmap_entry_t *ent;
ent = strmap_get(addressmap, *addrp); ent = strmap_get(addressmap, *addrp);
tor_assert(ent); tor_assert(ent);

View file

@ -211,22 +211,6 @@ dirserv_get_nickname_by_digest(const char *digest)
return NULL; return NULL;
} }
#if 0
/** Return true iff any router named <b>nickname</b> with <b>digest</b>
* is in the verified fingerprint list. */
static int
router_nickname_is_approved(const char *nickname, const char *digest)
{
const char *n;
n = dirserv_get_nickname_by_digest(digest);
if (n && !strcasecmp(n,nickname))
return 1;
else
return 0;
}
#endif
/** Clear the current fingerprint list. */ /** Clear the current fingerprint list. */
void void
dirserv_free_fingerprint_list() dirserv_free_fingerprint_list()

View file

@ -251,10 +251,6 @@ typedef enum {
/** State for an exit connection: waiting to be removed. */ /** State for an exit connection: waiting to be removed. */
#define EXIT_CONN_STATE_RESOLVEFAILED 4 #define EXIT_CONN_STATE_RESOLVEFAILED 4
#define _EXIT_CONN_STATE_MAX 4 #define _EXIT_CONN_STATE_MAX 4
#if 0
#define EXIT_CONN_STATE_CLOSE 3 /* flushing the buffer, then will close */
#define EXIT_CONN_STATE_CLOSE_WAIT 4 /* have sent a destroy, awaiting a confirmation */
#endif
/* the AP state values must be disjoint from the EXIT state values */ /* the AP state values must be disjoint from the EXIT state values */
#define _AP_CONN_STATE_MIN 5 #define _AP_CONN_STATE_MIN 5

View file

@ -378,44 +378,6 @@ rep_history_clean(time_t before)
} }
} }
#if 0
void
write_rep_history(const char *filename)
{
FILE *f = NULL;
char *tmpfile;
int completed = 0;
or_history_t *or_history;
link_history_t *link_history;
strmap_iter_t *lhist_it;
strmap_iter_t *orhist_it;
void *or_history_p, *link_history_p;
const char *name1;
tmpfile = tor_malloc(strlen(filename)+5);
tor_snprintf(tmpfile, strlen(filename)+5, "%s_tmp", filename);
f = fopen(tmpfile, "w");
if (!f) goto done;
for (orhist_it = strmap_iter_init(history_map); !strmap_iter_done(orhist_it);
orhist_it = strmap_iter_next(history_map,orhist_it)) {
strmap_iter_get(orhist_it, &name1, &or_history_p);
or_history = (or_history_t*) or_history_p;
fprintf(f, "link %s connected:u%ld failed:%uld uptime:%uld",
name1, or_history->since1,
}
done:
if (f)
fclose(f);
if (completed)
replace_file(filename, tmpfile);
else
unlink(tmpfile);
tor_free(tmpfile);
}
#endif
#define NUM_SECS_ROLLING_MEASURE 10 #define NUM_SECS_ROLLING_MEASURE 10
#define NUM_SECS_BW_SUM_IS_VALID (24*60*60) /* one day */ #define NUM_SECS_BW_SUM_IS_VALID (24*60*60) /* one day */
#define NUM_SECS_BW_SUM_INTERVAL (15*60) #define NUM_SECS_BW_SUM_INTERVAL (15*60)

View file

@ -1389,27 +1389,6 @@ get_next_token(const char **s, where_syntax where)
done_tokenizing: done_tokenizing:
#if 0
for (i = 0; token_table[i].t ; ++i) {
if (token_table[i].v == tok->tp) {
fputs(token_table[i].t, stdout);
break;
i = -1;
}
}
if (i) {
if (tok->tp == _UNRECOGNIZED) fputs("UNRECOGNIZED", stdout);
if (tok->tp == _ERR) fputs("ERR",stdout);
if (tok->tp == _EOF) fputs("EOF",stdout);
if (tok->tp == _NIL) fputs("_NIL",stdout);
}
for (i = 0; i < tok->n_args; ++i) {
fprintf(stdout," \"%s\"", tok->args[i]);
}
if (tok->error) { fprintf(stdout," *%s*", tok->error); }
fputs("\n",stdout);
#endif
return tok; return tok;
#undef RET_ERR #undef RET_ERR
} }