diff options
author | Nick Mathewson <nickm@torproject.org> | 2008-02-05 23:20:49 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2008-02-05 23:20:49 +0000 |
commit | 12071df6c88415e60c990f230dcb67635431aafa (patch) | |
tree | 161c07b560b5e3464ce99ba98fe29c944a7ba8c7 /src/or/command.c | |
parent | ff9bd0fd3a0acd38e495a3ff7c85011b51c9fcb6 (diff) | |
download | tor-12071df6c88415e60c990f230dcb67635431aafa.tar.gz tor-12071df6c88415e60c990f230dcb67635431aafa.zip |
r17930@catbus: nickm | 2008-02-05 18:20:40 -0500
Initial attempts to track down bug 600, and refactor possibly offending code. 1) complain early if circuit state is set to OPEN when an onionskin is pending. 2) refactor onionskin field into one only used when n_conn is pending, and a separate onionskin field waiting for attention by a cpuworker. This might even fix the bug. More likely, it will make it fail with a more useful core.
svn:r13394
Diffstat (limited to 'src/or/command.c')
-rw-r--r-- | src/or/command.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/or/command.c b/src/or/command.c index ea626416bc..1d16fdb7af 100644 --- a/src/or/command.c +++ b/src/or/command.c @@ -262,11 +262,11 @@ command_process_create_cell(cell_t *cell, or_connection_t *conn) circ->_base.purpose = CIRCUIT_PURPOSE_OR; circuit_set_state(TO_CIRCUIT(circ), CIRCUIT_STATE_ONIONSKIN_PENDING); if (cell->command == CELL_CREATE) { - circ->_base.onionskin = tor_malloc(ONIONSKIN_CHALLENGE_LEN); - memcpy(circ->_base.onionskin, cell->payload, ONIONSKIN_CHALLENGE_LEN); + char *onionskin = tor_malloc(ONIONSKIN_CHALLENGE_LEN); + memcpy(onionskin, cell->payload, ONIONSKIN_CHALLENGE_LEN); /* hand it off to the cpuworkers, and then return. */ - if (assign_to_cpuworker(NULL, CPUWORKER_TASK_ONION, circ) < 0) { + if (assign_onionskin_to_cpuworker(NULL, circ, onionskin) < 0) { log_warn(LD_GENERAL,"Failed to hand off onionskin. Closing."); circuit_mark_for_close(TO_CIRCUIT(circ), END_CIRC_REASON_INTERNAL); return; |