[or-cvs] minor code cleanup

Roger Dingledine arma at seul.org
Wed Mar 5 20:03:08 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 connection.c or.h 
Log Message:
minor code cleanup


Index: circuit.c
===================================================================
RCS file: /home/or/cvsroot/src/or/circuit.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- circuit.c	18 Feb 2003 01:35:55 -0000	1.24
+++ circuit.c	5 Mar 2003 20:03:05 -0000	1.25
@@ -327,11 +327,11 @@
     return -1;
   }
 
-  if((!conn && cell_direction == CELL_DIRECTION_OUT) || (conn && conn->type == CONN_TYPE_EXIT)) {
+  if(cell_direction == CELL_DIRECTION_OUT && (!conn || conn->type == CONN_TYPE_EXIT)) {
     log(LOG_DEBUG,"circuit_deliver_data_cell(): Sending to exit.");
     return connection_exit_process_data_cell(cell, circ);
   }
-  if((!conn && cell_direction == CELL_DIRECTION_IN) || (conn && conn->type == CONN_TYPE_AP)) {
+  if(cell_direction == CELL_DIRECTION_IN && (!conn || conn->type == CONN_TYPE_AP)) {
     log(LOG_DEBUG,"circuit_deliver_data_cell(): Sending to AP.");
     return connection_ap_process_data_cell(cell, circ);
   }
@@ -352,7 +352,7 @@
   if(!out)
     return -1;
 
-  if(cell_direction == CELL_DIRECTION_IN) { //crypt_type == 'e') {
+  if(cell_direction == CELL_DIRECTION_IN) { 
     if(circ->cpath) { /* we're at the beginning of the circuit. We'll want to do layered crypts. */
       for (i=circ->cpathlen-1; i >= 0; i--) /* moving from first to last hop 
                                        * Remember : cpath is in reverse order, i.e. last hop first
@@ -379,7 +379,7 @@
       }
       memcpy(in,out,inlen);
     }
-  } else if(cell_direction == CELL_DIRECTION_OUT) { //crypt_type == 'd') {
+  } else if(cell_direction == CELL_DIRECTION_OUT) { 
     if(circ->cpath) { /* we're at the beginning of the circuit. We'll want to do layered crypts. */
       for (i=0; i < circ->cpathlen; i++) /* moving from last to first hop 
                                           * Remember : cpath is in reverse order, i.e. last hop first

Index: connection.c
===================================================================
RCS file: /home/or/cvsroot/src/or/connection.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- connection.c	28 Feb 2003 23:49:52 -0000	1.37
+++ connection.c	5 Mar 2003 20:03:05 -0000	1.38
@@ -767,7 +767,7 @@
   printf("\n");
 #endif
 
-  /* retrieve cell info from outbuf (create the struct from the string) */
+  /* retrieve cell info from outbuf (create the host-order struct from the network-order string) */
   memset(&cell,0,sizeof(cell_t)); /* zero it out to start */
   cell.aci = ntohs(*(aci_t *)outbuf);
   cell.command = *(outbuf+2);

Index: or.h
===================================================================
RCS file: /home/or/cvsroot/src/or/or.h,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- or.h	18 Feb 2003 01:55:51 -0000	1.47
+++ or.h	5 Mar 2003 20:03:05 -0000	1.48
@@ -237,8 +237,6 @@
 
   int onions_handled_this_second;
 
-//  uint16_t aci; /* anonymous connection identifier */
-
 /* used by OR and OP: */
 
   uint32_t bandwidth; /* connection bandwidth */
@@ -650,6 +648,7 @@
 
 int connection_dns_finished_flushing(connection_t *conn);
 int connection_dns_process_inbuf(connection_t *conn);
+void init_cache_tree(void);
 int dns_resolve(connection_t *exitconn);
 int dns_master_start(void);
 



More information about the tor-commits mailing list