aboutsummaryrefslogtreecommitdiff
path: root/src/or/channel.c
diff options
context:
space:
mode:
authorAndrea Shepard <andrea@torproject.org>2012-10-08 20:06:40 -0700
committerAndrea Shepard <andrea@torproject.org>2012-10-08 20:06:40 -0700
commite877d02fdde73934e727346a9da11018681a4c14 (patch)
treefe070d027301b9132592fb65a984add91a53bccc /src/or/channel.c
parent17356fe7fd96af9285f8f9507b111373fd6fb891 (diff)
downloadtor-e877d02fdde73934e727346a9da11018681a4c14.tar
tor-e877d02fdde73934e727346a9da11018681a4c14.tar.gz
Eliminate unnecessary channel_set_cell_handler(), channel_set_var_cell_handler() in channel.c
Diffstat (limited to 'src/or/channel.c')
-rw-r--r--src/or/channel.c89
1 files changed, 1 insertions, 88 deletions
diff --git a/src/or/channel.c b/src/or/channel.c
index b3ab2f073..f987caed5 100644
--- a/src/or/channel.c
+++ b/src/or/channel.c
@@ -916,50 +916,7 @@ void
}
/**
- * Set the fixed-length cell handler for a channel
- *
- * This function sets the fixed-length cell handler for a channel and
- * processes any incoming cells that had been blocked in the queue because
- * none was available.
- *
- * @param chan Channel to set the fixed-length cell handler for
- * @param cell_handler Function pointer to new fixed-length cell handler
- */
-
-void
-channel_set_cell_handler(channel_t *chan,
- void (*cell_handler)(channel_t *, cell_t *))
-{
- int changed = 0;
-
- tor_assert(chan);
- tor_assert(!(chan->is_listener));
- tor_assert(chan->state == CHANNEL_STATE_OPENING ||
- chan->state == CHANNEL_STATE_OPEN ||
- chan->state == CHANNEL_STATE_MAINT);
-
- log_debug(LD_CHANNEL,
- "Setting cell_handler callback for channel %p to %p",
- chan, cell_handler);
-
- /*
- * Keep track whether we've changed it so we know if there's any point in
- * re-running the queue.
- */
- if (cell_handler != chan->u.cell_chan.cell_handler) changed = 1;
-
- /* Change it */
- chan->u.cell_chan.cell_handler = cell_handler;
-
- /* Re-run the queue if we have one and there's any reason to */
- if (chan->u.cell_chan.cell_queue &&
- (smartlist_len(chan->u.cell_chan.cell_queue) > 0) &&
- changed &&
- chan->u.cell_chan.cell_handler) channel_process_cells(chan);
-}
-
-/**
- * Set the both cell handlers for a channel
+ * Set both cell handlers for a channel
*
* This function sets both the fixed-length and variable length cell handlers
* for a channel and processes any incoming cells that had been blocked in the
@@ -1011,50 +968,6 @@ channel_set_cell_handlers(channel_t *chan,
}
/**
- * Set the variable-length cell handler for a channel
- *
- * This function sets the variable-length cell handler for a channel and
- * processes any incoming cells that had been blocked in the queue because
- * none was available.
- *
- * @param chan Channel to set the variable-length cell handler for
- * @param cell_handler Function pointer to new variable-length cell handler
- */
-
-void
-channel_set_var_cell_handler(channel_t *chan,
- void (*var_cell_handler)(channel_t *,
- var_cell_t *))
-{
- int changed = 0;
-
- tor_assert(chan);
- tor_assert(!(chan->is_listener));
- tor_assert(chan->state == CHANNEL_STATE_OPENING ||
- chan->state == CHANNEL_STATE_OPEN ||
- chan->state == CHANNEL_STATE_MAINT);
-
- log_debug(LD_CHANNEL,
- "Setting var_cell_handler callback for channel %p to %p",
- chan, var_cell_handler);
-
- /*
- * Keep track whether we've changed it so we know if there's any point in
- * re-running the queue.
- */
- if (var_cell_handler != chan->u.cell_chan.var_cell_handler) changed = 1;
-
- /* Change it */
- chan->u.cell_chan.var_cell_handler = var_cell_handler;
-
- /* Re-run the queue if we have one and there's any reason to */
- if (chan->u.cell_chan.cell_queue &&
- (smartlist_len(chan->u.cell_chan.cell_queue) > 0) &&
- changed && chan->u.cell_chan.var_cell_handler)
- channel_process_cells(chan);
-}
-
-/**
* Request a channel be closed
*
* This function tries to close a channel_t; it will go into the CLOSING