diff options
Diffstat (limited to 'src/or/onion.c')
-rw-r--r-- | src/or/onion.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/or/onion.c b/src/or/onion.c index e4cdea6bb0..d4a65022fc 100644 --- a/src/or/onion.c +++ b/src/or/onion.c @@ -26,7 +26,7 @@ /** 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 { - TAILQ_ENTRY(onion_queue_t) next; + TOR_TAILQ_ENTRY(onion_queue_t) next; or_circuit_t *circ; create_cell_t *onionskin; time_t when_added; @@ -36,8 +36,8 @@ typedef struct onion_queue_t { #define ONIONQUEUE_WAIT_CUTOFF 5 /** Queue of circuits waiting for CPU workers, or NULL if the list is empty.*/ -TAILQ_HEAD(onion_queue_head_t, onion_queue_t) ol_list = - TAILQ_HEAD_INITIALIZER(ol_list); +TOR_TAILQ_HEAD(onion_queue_head_t, onion_queue_t) ol_list = + TOR_TAILQ_HEAD_INITIALIZER(ol_list); /** Number of entries of each type currently in ol_list. */ static int ol_entries[MAX_ONION_HANDSHAKE_TYPE+1]; @@ -82,6 +82,8 @@ have_room_for_onionskin(uint16_t type) if (type == ONION_HANDSHAKE_TYPE_TAP && tap_usec / 1000 > (uint64_t)options->MaxOnionQueueDelay * 2 / 3) return 0; +#else + (void) type; #endif return 1; @@ -120,11 +122,11 @@ onion_pending_add(or_circuit_t *circ, create_cell_t *onionskin) ++ol_entries[onionskin->handshake_type]; circ->onionqueue_entry = tmp; - TAILQ_INSERT_TAIL(&ol_list, tmp, next); + TOR_TAILQ_INSERT_TAIL(&ol_list, tmp, next); /* cull elderly requests. */ while (1) { - onion_queue_t *head = TAILQ_FIRST(&ol_list); + onion_queue_t *head = TOR_TAILQ_FIRST(&ol_list); if (now - head->when_added < (time_t)ONIONQUEUE_WAIT_CUTOFF) break; @@ -145,7 +147,7 @@ or_circuit_t * onion_next_task(create_cell_t **onionskin_out) { or_circuit_t *circ; - onion_queue_t *head = TAILQ_FIRST(&ol_list); + onion_queue_t *head = TOR_TAILQ_FIRST(&ol_list); if (!head) return NULL; /* no onions pending, we're done */ @@ -184,7 +186,7 @@ onion_pending_remove(or_circuit_t *circ) static void onion_queue_entry_remove(onion_queue_t *victim) { - TAILQ_REMOVE(&ol_list, victim, next); + TOR_TAILQ_REMOVE(&ol_list, victim, next); if (victim->circ) victim->circ->onionqueue_entry = NULL; @@ -202,7 +204,7 @@ void clear_pending_onions(void) { onion_queue_t *victim; - while ((victim = TAILQ_FIRST(&ol_list))) { + while ((victim = TOR_TAILQ_FIRST(&ol_list))) { onion_queue_entry_remove(victim); } memset(ol_entries, 0, sizeof(ol_entries)); |