summaryrefslogtreecommitdiff
path: root/src/or/circuitmux.c
diff options
context:
space:
mode:
authorAndrea Shepard <andrea@torproject.org>2012-09-27 12:20:05 -0700
committerAndrea Shepard <andrea@torproject.org>2012-10-10 00:44:45 -0700
commiteade7a37cdc9c128d66d2c2c74d7056516fde364 (patch)
tree2b7e0152fc4a701d3bc333900f50eb522f474a52 /src/or/circuitmux.c
parent930e3d611a7983dc0d5558b21b79e81f72cb7158 (diff)
downloadtor-eade7a37cdc9c128d66d2c2c74d7056516fde364.tar.gz
tor-eade7a37cdc9c128d66d2c2c74d7056516fde364.zip
Add cmux policy notify_set_n_cells() and notify_xmit_cells() callbacks
Diffstat (limited to 'src/or/circuitmux.c')
-rw-r--r--src/or/circuitmux.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/or/circuitmux.c b/src/or/circuitmux.c
index 5a5739fcd9..53d3a1ba7a 100644
--- a/src/or/circuitmux.c
+++ b/src/or/circuitmux.c
@@ -995,6 +995,19 @@ circuitmux_set_num_cells(circuitmux_t *cmux, circuit_t *circ,
cmux->n_cells -= hashent->muxinfo.cell_count;
cmux->n_cells += n_cells;
+ /* Do we need to notify a cmux policy? */
+ if (cmux->policy && cmux->policy_data &&
+ cmux->policy->notify_set_n_cells) {
+ /* Yeah; assert that we have circuit policy data */
+ tor_assert(hashent->muxinfo.policy_data);
+ /* ... and call notify_set_n_cells */
+ cmux->policy->notify_set_n_cells(cmux,
+ cmux->policy_data,
+ circ,
+ hashent->muxinfo.policy_data,
+ n_cells);
+ }
+
/*
* Update cmux active circuit counter: is the old cell count > 0 and the
* new cell count == 0 ?