aboutsummaryrefslogtreecommitdiff
path: root/src/or/channel.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-10-12 17:58:01 -0400
committerNick Mathewson <nickm@torproject.org>2012-10-12 17:58:01 -0400
commit7c9954a02abd16e5c74c2a5dea9ed0f65af230be (patch)
treedcc2887b08dc89b2693245395e4cd68e3c70b26a /src/or/channel.h
parentb555388dac71696c6a1028805094e16b5e5b2b82 (diff)
downloadtor-7c9954a02abd16e5c74c2a5dea9ed0f65af230be.tar
tor-7c9954a02abd16e5c74c2a5dea9ed0f65af230be.tar.gz
Use SIMPLEQ, not smartlist_t, for channel cell queues.
This lets us use fewer memory allocations, and avoid O(n^2) iterations
Diffstat (limited to 'src/or/channel.h')
-rw-r--r--src/or/channel.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/or/channel.h b/src/or/channel.h
index cb9835a9f..ccb8fe89e 100644
--- a/src/or/channel.h
+++ b/src/or/channel.h
@@ -10,6 +10,7 @@
#define _TOR_CHANNEL_H
#include "or.h"
+#include "tor_queue.h"
#include "circuitmux.h"
/* Channel handler function pointer typedefs */
@@ -17,6 +18,10 @@ typedef void (*channel_listener_fn_ptr)(channel_listener_t *, channel_t *);
typedef void (*channel_cell_handler_fn_ptr)(channel_t *, cell_t *);
typedef void (*channel_var_cell_handler_fn_ptr)(channel_t *, var_cell_t *);
+struct cell_queue_entry_s;
+SIMPLEQ_HEAD(chan_cell_queue, cell_queue_entry_s) incoming_queue;
+typedef struct chan_cell_queue chan_cell_queue_t;
+
/*
* Channel struct; see the channel_t typedef in or.h. A channel is an
* abstract interface for the OR-to-OR connection, similar to connection_or_t,
@@ -120,10 +125,10 @@ struct channel_s {
channel_t *next_with_same_id, *prev_with_same_id;
/* List of incoming cells to handle */
- smartlist_t *incoming_queue;
+ chan_cell_queue_t incoming_queue;
/* List of queued outgoing cells */
- smartlist_t *outgoing_queue;
+ chan_cell_queue_t outgoing_queue;
/* Circuit mux for circuits sending on this channel */
circuitmux_t *cmux;