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/cpuworker.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/cpuworker.c')
-rw-r--r-- | src/or/cpuworker.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/or/cpuworker.c b/src/or/cpuworker.c index c86753fb58..1ed91b0426 100644 --- a/src/or/cpuworker.c +++ b/src/or/cpuworker.c @@ -181,8 +181,8 @@ connection_cpu_process_inbuf(connection_t *conn) log_debug(LD_OR,"processed onion for a circ that's gone. Dropping."); goto done_processing; } - tor_assert(circ->p_conn); - if (onionskin_answer(circ, CELL_CREATED, buf+TAG_LEN, + tor_assert(! CIRCUIT_IS_ORIGIN(circ)); + if (onionskin_answer(TO_OR_CIRCUIT(circ), CELL_CREATED, buf+TAG_LEN, buf+TAG_LEN+ONIONSKIN_REPLY_LEN) < 0) { log_warn(LD_OR,"onionskin_answer failed. Closing."); circuit_mark_for_close(circ, END_CIRC_REASON_INTERNAL); @@ -386,7 +386,7 @@ spawn_enough_cpuworkers(void) static void process_pending_task(connection_t *cpuworker) { - circuit_t *circ; + or_circuit_t *circ; tor_assert(cpuworker); @@ -444,7 +444,7 @@ int assign_to_cpuworker(connection_t *cpuworker, uint8_t question_type, void *task) { - circuit_t *circ; + or_circuit_t *circ; char tag[TAG_LEN]; tor_assert(question_type == CPUWORKER_TASK_ONION); @@ -454,7 +454,7 @@ assign_to_cpuworker(connection_t *cpuworker, uint8_t question_type, if (question_type == CPUWORKER_TASK_ONION) { circ = task; - tor_assert(circ->onionskin); + tor_assert(circ->_base.onionskin); if (num_cpuworkers_busy == num_cpuworkers) { log_debug(LD_OR,"No idle cpuworkers. Queuing."); @@ -484,9 +484,9 @@ assign_to_cpuworker(connection_t *cpuworker, uint8_t question_type, connection_write_to_buf((char*)&question_type, 1, cpuworker); connection_write_to_buf(tag, sizeof(tag), cpuworker); - connection_write_to_buf(circ->onionskin, ONIONSKIN_CHALLENGE_LEN, + connection_write_to_buf(circ->_base.onionskin, ONIONSKIN_CHALLENGE_LEN, cpuworker); - tor_free(circ->onionskin); + tor_free(circ->_base.onionskin); } return 0; } |