[or-cvs] relay queues are obsolete (woo!)

Roger Dingledine arma at seul.org
Fri Jun 13 09:59:35 UTC 2003


Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/home/arma/work/onion/cvs/src/or

Modified Files:
	circuit.c command.c onion.c or.h 
Log Message:
relay queues are obsolete (woo!)

they used to be used for
* queueing relay cells at the edge of the network, when windows are empty
* queueing relay cells that arrive after an onion but before the onion
  has been processed.
both of these uses are gone. so out they go.


Index: circuit.c
===================================================================
RCS file: /home/or/cvsroot/src/or/circuit.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- circuit.c	12 Jun 2003 10:16:33 -0000	1.50
+++ circuit.c	13 Jun 2003 09:59:32 -0000	1.51
@@ -78,21 +78,11 @@
 }
 
 void circuit_free(circuit_t *circ) {
-  struct relay_queue_t *tmpd;
-  
   if (circ->n_crypto)
     crypto_free_cipher_env(circ->n_crypto);
   if (circ->p_crypto)
     crypto_free_cipher_env(circ->p_crypto);
-
   circuit_free_cpath(circ->cpath);
-  while(circ->relay_queue) {
-    tmpd = circ->relay_queue;
-    circ->relay_queue = tmpd->next;
-    free(tmpd->cell);
-    free(tmpd);
-  }
-
   free(circ);
 }
 

Index: command.c
===================================================================
RCS file: /home/or/cvsroot/src/or/command.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- command.c	13 Jun 2003 09:20:23 -0000	1.33
+++ command.c	13 Jun 2003 09:59:32 -0000	1.34
@@ -167,8 +167,7 @@
   }
 
   if(circ->state == CIRCUIT_STATE_ONIONSKIN_PENDING) {
-    log(LOG_DEBUG,"command_process_relay_cell(): circuit in create_wait. Queueing relay cell.");
-    onion_pending_relay_add(circ, cell);
+    log(LOG_DEBUG,"command_process_relay_cell(): circuit in create_wait. Dropping.");
     return;
   }
 

Index: onion.c
===================================================================
RCS file: /home/or/cvsroot/src/or/onion.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -d -r1.53 -r1.54
--- onion.c	12 Jun 2003 10:16:33 -0000	1.53
+++ onion.c	13 Jun 2003 09:59:32 -0000	1.54
@@ -67,7 +67,6 @@
 }
 
 void onion_pending_process_one(void) {
-  struct relay_queue_t *tmpd;
   circuit_t *circ; 
 
   if(!ol_list)
@@ -88,11 +87,7 @@
     onion_pending_remove(circ);
     circuit_close(circ);
   } else {
-    log(LOG_DEBUG,"onion_pending_process_one(): Succeeded. Delivering queued relay cells.");
-    for(tmpd = ol_list->relay_cells; tmpd; tmpd=tmpd->next) {
-      log(LOG_DEBUG,"onion_pending_process_one(): Delivering relay cell...");
-      command_process_relay_cell(tmpd->cell, circ->p_conn); 
-    }
+    log(LOG_DEBUG,"onion_pending_process_one(): Succeeded.");
     onion_pending_remove(circ);
   }
   return;
@@ -103,7 +98,6 @@
  */
 void onion_pending_remove(circuit_t *circ) {
   struct onion_queue_t *tmpo, *victim;
-  struct relay_queue_t *tmpd;
 
   if(!ol_list)
     return; /* nothing here. */
@@ -133,49 +127,7 @@
 
   /* now victim points to the element that needs to be removed */
 
-  /* first dump the attached relay cells too, if any */
-  while(victim->relay_cells) {
-    tmpd = victim->relay_cells;
-    victim->relay_cells = tmpd->next;
-    free(tmpd->cell);
-    free(tmpd);
-  }
- 
   free(victim); 
-
-}
-
-struct relay_queue_t *relay_queue_add(struct relay_queue_t *list, cell_t *cell, crypt_path_t *layer_hint) {
-  struct relay_queue_t *tmpd, *newd;
-
-  newd = tor_malloc(sizeof(struct relay_queue_t));
-  memset(newd, 0, sizeof(struct relay_queue_t));
-  newd->cell = tor_malloc(sizeof(cell_t));
-  memcpy(newd->cell, cell, sizeof(cell_t));
-  newd->layer_hint = layer_hint;
-
-  if(!list) {
-    return newd;
-  }
-  for(tmpd = list; tmpd->next; tmpd=tmpd->next) ;
-  /* now tmpd->next is null */
-  tmpd->next = newd;
-  return list;
-}
-
-/* a relay cell has arrived for a circuit which is still pending. Find
- * the right entry in ol_list, and add it to the end of the 'relay_cells'
- * list.
- */
-void onion_pending_relay_add(circuit_t *circ, cell_t *cell) {
-  struct onion_queue_t *tmpo;
-
-  for(tmpo=ol_list; tmpo; tmpo=tmpo->next) {
-    if(tmpo->circ == circ) {
-      tmpo->relay_cells = relay_queue_add(tmpo->relay_cells, cell, NULL);
-      return;
-    }
-  }
 }
 
 /* learn keys, initialize, then send a created cell back */

Index: or.h
===================================================================
RCS file: /home/or/cvsroot/src/or/or.h,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -d -r1.89 -r1.90
--- or.h	12 Jun 2003 10:16:33 -0000	1.89
+++ or.h	13 Jun 2003 09:59:33 -0000	1.90
@@ -352,12 +352,6 @@
 
 typedef struct crypt_path_t crypt_path_t;
 
-struct relay_queue_t {
-  cell_t *cell;
-  crypt_path_t *layer_hint;
-  struct relay_queue_t *next;
-};
-
 /* struct for a path (circuit) through the network */
 typedef struct {
   uint32_t n_addr;
@@ -372,8 +366,6 @@
   aci_t p_aci; /* connection identifiers */
   aci_t n_aci;
 
-  struct relay_queue_t *relay_queue; /* for queueing cells at the edges */
-
   crypto_cipher_env_t *p_crypto; /* used only for intermediate hops */
   crypto_cipher_env_t *n_crypto;
 
@@ -394,7 +386,6 @@
 
 struct onion_queue_t {
   circuit_t *circ;
-  struct relay_queue_t *relay_cells;
   struct onion_queue_t *next;
 };
 
@@ -749,8 +740,6 @@
 int onion_pending_check(void);
 void onion_pending_process_one(void);
 void onion_pending_remove(circuit_t *circ);
-struct relay_queue_t *relay_queue_add(struct relay_queue_t *list, cell_t *cell, crypt_path_t *layer_hint);
-void onion_pending_relay_add(circuit_t *circ, cell_t *cell);
 
 /* uses a weighted coin with weight cw to choose a route length */
 int chooselen(double cw);



More information about the tor-commits mailing list