Commit 2e05b9cc authored by Nick Mathewson's avatar Nick Mathewson 🦞
Browse files

Remove dead code


svn:r794
parent 7d441ec6
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -758,7 +758,7 @@ int circuit_send_next_onion_skin(circuit_t *circ) {
    assert(circ->state == CIRCUIT_STATE_BUILDING);
    log_fn(LOG_DEBUG,"starting to send subsequent skin.");
    r = onion_extend_cpath(&circ->cpath, circ->desired_cpath_len, &router);
    if (r==1) {
    if (r==1 || !router) {
      /* done building the circuit. whew. */
      circ->state = CIRCUIT_STATE_OPEN;
      log_fn(LOG_INFO,"circuit built! (%d hops long)",circ->desired_cpath_len);
@@ -772,12 +772,6 @@ int circuit_send_next_onion_skin(circuit_t *circ) {
    }
    hop = circ->cpath->prev;

    router = router_get_by_addr_port(hop->addr,hop->port);
    if(!router) {
      log_fn(LOG_WARN,"couldn't lookup router %d:%d",hop->addr,hop->port);
      return -1;
    }

    memset(&cell, 0, sizeof(cell_t));
    cell.command = CELL_RELAY; 
    cell.circ_id = circ->n_circ_id;
+0 −32
Original line number Diff line number Diff line
@@ -249,38 +249,6 @@ static int count_acceptable_routers(routerinfo_t **rarray, int rarray_len) {
  return num;
}

/* XXX This function should be replaced by calls to onion_extend_cpath */
crypt_path_t *onion_generate_cpath(routerinfo_t **firsthop) {
  int routelen;
  crypt_path_t *cpath=NULL;
  int r;
  directory_t *dir;
  routerinfo_t **rarray;
  int rarray_len;

  assert(firsthop);
  *firsthop = NULL;

  router_get_directory(&dir);
  rarray = dir->routers;
  rarray_len = dir->n_routers;
  
  routelen = new_route_len(options.CoinWeight, rarray, rarray_len);
  if (routelen < 0) return NULL;
  
  while (1) {
    r = onion_extend_cpath(&cpath, routelen, cpath ? NULL : firsthop);
    if (r < 0) {
      if (cpath) circuit_free_cpath(cpath);
      return NULL;
    } else if (r == 1) {
      break;
    }
    /* r == 0; keep on chugging. */
  }
  return cpath;
}

int onion_extend_cpath(crypt_path_t **head_ptr, int path_len, routerinfo_t **router_out)
{
  int cur_len;
+0 −1
Original line number Diff line number Diff line
@@ -693,7 +693,6 @@ void onion_pending_remove(circuit_t *circ);

int onionskin_answer(circuit_t *circ, unsigned char *payload, unsigned char *keys);

crypt_path_t *onion_generate_cpath(routerinfo_t **firsthop);
int onion_extend_cpath(crypt_path_t **head_ptr, int path_len, routerinfo_t **router_out);

int onion_skin_create(crypto_pk_env_t *router_key,