diff options
author | Nick Mathewson <nickm@torproject.org> | 2013-10-02 15:11:34 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-01-14 11:31:12 -0500 |
commit | fb5ebfb50770062c77534d4db4c6a9c5ad475fa0 (patch) | |
tree | 52949fe80a637906c13a1f095306a9f1849692e8 /src/or/or.h | |
parent | 6c9c54e7fa8841e3c4d4d24f5933d433171d1112 (diff) | |
download | tor-fb5ebfb50770062c77534d4db4c6a9c5ad475fa0.tar.gz tor-fb5ebfb50770062c77534d4db4c6a9c5ad475fa0.zip |
Avoid chan/circ linear lookups for requests
The solution I took is to not free a circuit with a pending
uncancellable work item, but rather to set its magic number to a
sentinel value. When we get a work item, we check whether the circuit
has that magic sentinel, and if so, we free it rather than processing
the reply.
Diffstat (limited to 'src/or/or.h')
-rw-r--r-- | src/or/or.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/or/or.h b/src/or/or.h index 4ff3555845..5978504c18 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -2725,8 +2725,14 @@ typedef struct { time_t expiry_time; } cpath_build_state_t; +/** "magic" value for an origin_circuit_t */ #define ORIGIN_CIRCUIT_MAGIC 0x35315243u +/** "magic" value for an or_circuit_t */ #define OR_CIRCUIT_MAGIC 0x98ABC04Fu +/** "magic" value for a circuit that would have been freed by circuit_free, + * but which we're keeping around until a cpuworker reply arrives. See + * circuit_free() for more documentation. */ +#define DEAD_CIRCUIT_MAGIC 0xdeadc14c struct create_cell_t; |