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/rendcommon.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/rendcommon.c')
-rw-r--r-- | src/or/rendcommon.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/src/or/rendcommon.c b/src/or/rendcommon.c index 1d5ce9c848..ab38e9f3a6 100644 --- a/src/or/rendcommon.c +++ b/src/or/rendcommon.c @@ -432,34 +432,41 @@ void rend_process_relay_cell(circuit_t *circ, int command, size_t length, const char *payload) { + or_circuit_t *or_circ = NULL; + origin_circuit_t *origin_circ = NULL; int r; + if (CIRCUIT_IS_ORIGIN(circ)) + origin_circ = TO_ORIGIN_CIRCUIT(circ); + else + or_circ = TO_OR_CIRCUIT(circ); + switch (command) { case RELAY_COMMAND_ESTABLISH_INTRO: - r = rend_mid_establish_intro(circ,payload,length); + r = rend_mid_establish_intro(or_circ,payload,length); break; case RELAY_COMMAND_ESTABLISH_RENDEZVOUS: - r = rend_mid_establish_rendezvous(circ,payload,length); + r = rend_mid_establish_rendezvous(or_circ,payload,length); break; case RELAY_COMMAND_INTRODUCE1: - r = rend_mid_introduce(circ,payload,length); + r = rend_mid_introduce(or_circ,payload,length); break; case RELAY_COMMAND_INTRODUCE2: - r = rend_service_introduce(circ,payload,length); + r = rend_service_introduce(origin_circ,payload,length); break; case RELAY_COMMAND_INTRODUCE_ACK: - r = rend_client_introduction_acked(circ,payload,length); + r = rend_client_introduction_acked(origin_circ,payload,length); break; case RELAY_COMMAND_RENDEZVOUS1: - r = rend_mid_rendezvous(circ,payload,length); + r = rend_mid_rendezvous(or_circ,payload,length); break; case RELAY_COMMAND_RENDEZVOUS2: - r = rend_client_receive_rendezvous(circ,payload,length); + r = rend_client_receive_rendezvous(origin_circ,payload,length); break; case RELAY_COMMAND_INTRO_ESTABLISHED: - r = rend_service_intro_established(circ,payload,length); + r = rend_service_intro_established(origin_circ,payload,length); break; case RELAY_COMMAND_RENDEZVOUS_ESTABLISHED: - r = rend_client_rendezvous_acked(circ,payload,length); + r = rend_client_rendezvous_acked(origin_circ,payload,length); break; default: tor_assert(0); |