diff options
author | Nick Mathewson <nickm@torproject.org> | 2006-07-23 07:37:35 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2006-07-23 07:37:35 +0000 |
commit | 7239262f71cfe829ff7c50b1d971534f0cda1dc4 (patch) | |
tree | 5d5d5d0aea6b5cc250a421a3a2ad43b3ad609a93 /src/or/onion.c | |
parent | 6d2eb77555bee021ef27bf40101f8eb3fc931357 (diff) | |
download | tor-7239262f71cfe829ff7c50b1d971534f0cda1dc4.tar.gz tor-7239262f71cfe829ff7c50b1d971534f0cda1dc4.zip |
Don't tell anybody, but we're going OO here. This patch splits
circuit_t into origin_circuit_t and or_circuit_t. I fixed some
segaults; there may be more. We still need to move more rendezvous
stuff into subtypes.
This is a trial run for splitting up connection_t; if the approach is
insane, please say so soon so we can do something smarter.
Also, this discards the old HALF_OPEN code, which nobody seems to
want.
svn:r6817
Diffstat (limited to 'src/or/onion.c')
-rw-r--r-- | src/or/onion.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/or/onion.c b/src/or/onion.c index 315c5f12dd..ba41f21a22 100644 --- a/src/or/onion.c +++ b/src/or/onion.c @@ -17,7 +17,7 @@ const char onion_c_id[] = /** Type for a linked list of circuits that are waiting for a free CPU worker * to process a waiting onion handshake. */ typedef struct onion_queue_t { - circuit_t *circ; + or_circuit_t *circ; time_t when_added; struct onion_queue_t *next; } onion_queue_t; @@ -35,7 +35,7 @@ static int ol_length=0; * if ol_list is too long, in which case do nothing and return -1. */ int -onion_pending_add(circuit_t *circ) +onion_pending_add(or_circuit_t *circ) { onion_queue_t *tmp; time_t now = time(NULL); @@ -75,7 +75,7 @@ onion_pending_add(circuit_t *circ) onion_pending_remove(ol_list->circ); log_info(LD_CIRC, "Circuit create request is too old; cancelling due to overload."); - circuit_mark_for_close(circ, END_CIRC_REASON_RESOURCELIMIT); + circuit_mark_for_close(TO_CIRCUIT(circ), END_CIRC_REASON_RESOURCELIMIT); } return 0; } @@ -83,10 +83,10 @@ onion_pending_add(circuit_t *circ) /** Remove the first item from ol_list and return it, or return * NULL if the list is empty. */ -circuit_t * +or_circuit_t * onion_next_task(void) { - circuit_t *circ; + or_circuit_t *circ; if (!ol_list) return NULL; /* no onions pending, we're done */ @@ -103,7 +103,7 @@ onion_next_task(void) * circ, remove and free that element. Leave circ itself alone. */ void -onion_pending_remove(circuit_t *circ) +onion_pending_remove(or_circuit_t *circ) { onion_queue_t *tmpo, *victim; |