aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2003-03-05 20:03:05 +0000
committerRoger Dingledine <arma@torproject.org>2003-03-05 20:03:05 +0000
commitf97ddd44cd76fa4b9cea507a93ce80a5166a3346 (patch)
tree16d3137407779dc9b6ae1a6b8f9c3cd4a5d47cfe
parentb19538923fd8ebea2eb831f08fef385e2d61d892 (diff)
downloadtor-f97ddd44cd76fa4b9cea507a93ce80a5166a3346.tar
tor-f97ddd44cd76fa4b9cea507a93ce80a5166a3346.tar.gz
minor code cleanup
svn:r166
-rw-r--r--src/or/circuit.c8
-rw-r--r--src/or/connection.c2
-rw-r--r--src/or/or.h3
3 files changed, 6 insertions, 7 deletions
diff --git a/src/or/circuit.c b/src/or/circuit.c
index fc3ec1ac2..044193dfc 100644
--- a/src/or/circuit.c
+++ b/src/or/circuit.c
@@ -327,11 +327,11 @@ int circuit_deliver_data_cell(cell_t *cell, circuit_t *circ, int cell_direction)
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 @@ int circuit_crypt(circuit_t *circ, char *in, int inlen, char cell_direction) {
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 @@ int circuit_crypt(circuit_t *circ, char *in, int inlen, char cell_direction) {
}
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
diff --git a/src/or/connection.c b/src/or/connection.c
index 4c4975257..63adb408d 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -767,7 +767,7 @@ int connection_process_cell_from_inbuf(connection_t *conn) {
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);
diff --git a/src/or/or.h b/src/or/or.h
index 7cc345c2f..0c737f285 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -237,8 +237,6 @@ struct connection_t {
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_dir_handle_listener_read(connection_t *conn);
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);