aboutsummaryrefslogtreecommitdiff
path: root/src/core/or/channel.c
diff options
context:
space:
mode:
authorteor <teor@torproject.org>2020-04-06 19:14:27 +1000
committerteor <teor@torproject.org>2020-04-09 11:00:04 +1000
commit2b66429fcfe3dbbaa559b0b2de910e0266f27698 (patch)
treef519a682ea4af580da623770e2a9298ad6677795 /src/core/or/channel.c
parent8f3cbe755bc6817a164fe59b5ed1916a1c71fb5b (diff)
downloadtor-2b66429fcfe3dbbaa559b0b2de910e0266f27698.tar.gz
tor-2b66429fcfe3dbbaa559b0b2de910e0266f27698.zip
core/or: Make some functions mockable
Preparation for testing circuit_extend(). Part of 33633.
Diffstat (limited to 'src/core/or/channel.c')
-rw-r--r--src/core/or/channel.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/core/or/channel.c b/src/core/or/channel.c
index 542b4d88bb..9c1e8368ed 100644
--- a/src/core/or/channel.c
+++ b/src/core/or/channel.c
@@ -2370,12 +2370,12 @@ channel_is_better(channel_t *a, channel_t *b)
* and set *launch_out to a boolean indicated whether the caller should try to
* launch a new channel with channel_connect().
*/
-channel_t *
-channel_get_for_extend(const char *rsa_id_digest,
- const ed25519_public_key_t *ed_id,
- const tor_addr_t *target_addr,
- const char **msg_out,
- int *launch_out)
+MOCK_IMPL(channel_t *,
+channel_get_for_extend,(const char *rsa_id_digest,
+ const ed25519_public_key_t *ed_id,
+ const tor_addr_t *target_addr,
+ const char **msg_out,
+ int *launch_out))
{
channel_t *chan, *best = NULL;
int n_inprogress_goodaddr = 0, n_old = 0;
@@ -2821,8 +2821,8 @@ channel_get_actual_remote_address(channel_t *chan)
* Subsequent calls to channel_get_{actual,canonical}_remote_{address,descr}
* may invalidate the return value from this function.
*/
-const char *
-channel_get_canonical_remote_descr(channel_t *chan)
+MOCK_IMPL(const char *,
+channel_get_canonical_remote_descr,(channel_t *chan))
{
tor_assert(chan);
tor_assert(chan->get_remote_descr);