Commit d4972bd2 authored by Nick Mathewson's avatar Nick Mathewson 🦀
Browse files

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


svn:r4435
parent e8331f9d
Loading
Loading
Loading
Loading
+0 −16
Original line number Diff line number Diff line
@@ -1237,22 +1237,6 @@ static void init_dh_param(void) {
  tor_assert(p);
  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
     supposedly it equals:
        2^1024 - 2^960 - 1 + 2^64 * { [2^894 pi] + 129093 }.
+0 −6
Original line number Diff line number Diff line
@@ -899,12 +899,6 @@ new_route_len(double cw, uint8_t purpose, smartlist_t *routers)
    tor_fragile_assert();
    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
  log_fn(LOG_DEBUG,"Chosen route length %d (%d routers available).",routelen,
         smartlist_len(routers));
+0 −26
Original line number Diff line number Diff line
@@ -285,9 +285,6 @@ options_act(void)
  or_options_t *options = get_options();
  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) {
    start_daemon();
  }
@@ -396,18 +393,6 @@ options_act(void)
    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
   * server descriptor.  (We could probably be more clever about only calling
   * 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.");
    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->AccountingStart) {
@@ -2437,12 +2417,6 @@ validate_data_directory(or_options_t *options)
    log_fn(LOG_ERR, "DataDirectory is too long.");
    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;
}

+0 −7
Original line number Diff line number Diff line
@@ -1792,13 +1792,6 @@ assert_connection_ok(connection_t *conn, time_t now)
    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.*/
#if 0
  if (conn->type != CONN_TYPE_OR && conn->type != CONN_TYPE_DIR)
+1 −0
Original line number Diff line number Diff line
@@ -810,6 +810,7 @@ addressmap_register_virtual_address(int type, char *new_address)

#if 0
  {
    /* Try to catch possible bugs */
    addressmap_entry_t *ent;
    ent = strmap_get(addressmap, *addrp);
    tor_assert(ent);
Loading