diff options
author | Nick Mathewson <nickm@torproject.org> | 2019-09-17 11:40:14 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2019-09-17 11:40:14 -0400 |
commit | 7f5c6a603cafff9870f487bc03fa2874dcf00f8d (patch) | |
tree | 0c8873676388c459ac108b3c595ad1b4eb67f290 /src/core/or/channeltls.c | |
parent | 4d7ce27105dfb7f04ef14a59d098d2f81363298c (diff) | |
download | tor-7f5c6a603cafff9870f487bc03fa2874dcf00f8d.tar.gz tor-7f5c6a603cafff9870f487bc03fa2874dcf00f8d.zip |
Move PROCESS_CELL macros outside of channel_tls_process_cell().
These macros are used in multiple functions, and as such really
don't belong within a single function.
Also #undef them once we are done with them.
This change makes practracker pass again.
Diffstat (limited to 'src/core/or/channeltls.c')
-rw-r--r-- | src/core/or/channeltls.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/core/or/channeltls.c b/src/core/or/channeltls.c index 25f3baf924..2bc2cba313 100644 --- a/src/core/or/channeltls.c +++ b/src/core/or/channeltls.c @@ -1027,6 +1027,16 @@ channel_tls_time_process_cell(cell_t *cell, channel_tls_t *chan, int *time, } #endif /* defined(KEEP_TIMING_STATS) */ +#ifdef KEEP_TIMING_STATS +#define PROCESS_CELL(tp, cl, cn) STMT_BEGIN { \ + ++num ## tp; \ + channel_tls_time_process_cell(cl, cn, & tp ## time , \ + channel_tls_process_ ## tp ## _cell); \ + } STMT_END +#else /* !(defined(KEEP_TIMING_STATS)) */ +#define PROCESS_CELL(tp, cl, cn) channel_tls_process_ ## tp ## _cell(cl, cn) +#endif /* defined(KEEP_TIMING_STATS) */ + /** * Handle an incoming cell on a channel_tls_t. * @@ -1046,16 +1056,6 @@ channel_tls_handle_cell(cell_t *cell, or_connection_t *conn) channel_tls_t *chan; int handshaking; -#ifdef KEEP_TIMING_STATS -#define PROCESS_CELL(tp, cl, cn) STMT_BEGIN { \ - ++num ## tp; \ - channel_tls_time_process_cell(cl, cn, & tp ## time , \ - channel_tls_process_ ## tp ## _cell); \ - } STMT_END -#else /* !(defined(KEEP_TIMING_STATS)) */ -#define PROCESS_CELL(tp, cl, cn) channel_tls_process_ ## tp ## _cell(cl, cn) -#endif /* defined(KEEP_TIMING_STATS) */ - tor_assert(cell); tor_assert(conn); @@ -1328,6 +1328,8 @@ channel_tls_handle_var_cell(var_cell_t *var_cell, or_connection_t *conn) } } +#undef PROCESS_CELL + /** * Update channel marks after connection_or.c has changed an address. * |