diff options
author | Andrea Shepard <andrea@torproject.org> | 2016-03-15 07:40:19 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-03-21 10:14:47 -0400 |
commit | bd87d37a861c541afbeb660b4d8dd62df14d5b45 (patch) | |
tree | ce2f375c8db8e9c3a08dd406342ce20bc92a8e79 /src/or/channeltls.c | |
parent | 1cdc7fddb2ed10d72f4e65e15d1af4d803a1acdb (diff) | |
download | tor-bd87d37a861c541afbeb660b4d8dd62df14d5b45.tar.gz tor-bd87d37a861c541afbeb660b4d8dd62df14d5b45.zip |
Make sure channel_t queues its own copy of incoming cells
Diffstat (limited to 'src/or/channeltls.c')
-rw-r--r-- | src/or/channeltls.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/or/channeltls.c b/src/or/channeltls.c index c90f569233..2a8451467c 100644 --- a/src/or/channeltls.c +++ b/src/or/channeltls.c @@ -1009,6 +1009,11 @@ channel_tls_time_process_cell(cell_t *cell, channel_tls_t *chan, int *time, * for cell types specific to the handshake for this transport protocol and * handles them, and queues all other cells to the channel_t layer, which * eventually will hand them off to command.c. + * + * The channel layer itself decides whether the cell should be queued or + * can be handed off immediately to the upper-layer code. It is responsible + * for copying in the case that it queues; we merely pass pointers through + * which we get from connection_or_process_cells_from_inbuf(). */ void @@ -1106,6 +1111,12 @@ channel_tls_handle_cell(cell_t *cell, or_connection_t *conn) * related and live below the channel_t layer, so no variable-length * cells ever get delivered in the current implementation, but I've left * the mechanism in place for future use. + * + * If we were handing them off to the upper layer, the channel_t queueing + * code would be responsible for memory management, and we'd just be passing + * pointers through from connection_or_process_cells_from_inbuf(). That + * caller always frees them after this function returns, so this function + * should never free var_cell. */ void |