aboutsummaryrefslogtreecommitdiff
path: root/src/core/or/channel.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/or/channel.c')
-rw-r--r--src/core/or/channel.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/core/or/channel.c b/src/core/or/channel.c
index 3886906875..596932b008 100644
--- a/src/core/or/channel.c
+++ b/src/core/or/channel.c
@@ -1418,6 +1418,7 @@ write_packed_cell(channel_t *chan, packed_cell_t *cell)
{
int ret = -1;
size_t cell_bytes;
+ uint8_t command = packed_cell_get_command(cell, chan->wide_circ_ids);
tor_assert(chan);
tor_assert(cell);
@@ -1452,6 +1453,16 @@ write_packed_cell(channel_t *chan, packed_cell_t *cell)
/* Successfully sent the cell. */
ret = 0;
+ /* Update padding statistics for the packed codepath.. */
+ rep_hist_padding_count_write(PADDING_TYPE_TOTAL);
+ if (command == CELL_PADDING)
+ rep_hist_padding_count_write(PADDING_TYPE_CELL);
+ if (chan->padding_enabled) {
+ rep_hist_padding_count_write(PADDING_TYPE_ENABLED_TOTAL);
+ if (command == CELL_PADDING)
+ rep_hist_padding_count_write(PADDING_TYPE_ENABLED_CELL);
+ }
+
done:
return ret;
}